The assembly :
The advantage is that opening the file with the Import Step function of Asm3 WB makes it possible to recover the sub-assemblies (with one detail in this example).
As a sub-assembly behaves like a single part, there is no need to constrain parts in sub-assemblies (unless of course your source file contains errors!)
You can see an animation :
http://help-freecad-jpg87.fr/02assembla ... epper.html
If you want the files to test or explanations, request them (approximately 5MB).
Small example made with Asm3 WB from a * .step file
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Small example made with Asm3 WB from a * .step file
My website : http://help-freecad-jpg87.fr updated 2023/11/06
Re: Small example made with Asm3 WB from a * .step file
Hi jpg87,
glad i found your example. may i ask how you made the animation?
i'm trying to animate an imported step-assembly (approx. 88 MB), which i've rebuilt in asm3 (RealThunder's latest release). everything worked very well so far, but i don't want to repeat the work in assembly4.
thx in advance
Al
glad i found your example. may i ask how you made the animation?
i'm trying to animate an imported step-assembly (approx. 88 MB), which i've rebuilt in asm3 (RealThunder's latest release). everything worked very well so far, but i don't want to repeat the work in assembly4.
thx in advance
Al
Re: Small example made with Asm3 WB from a * .step file
Hi Solarman,
The pilot mechanical link marked on the image (Join) leaves a rotating DOF between support 1 and pedal 2 :
After having set the Lock Angle parameter of the link to True, the value of the angle can then hijack the position of the mechanism which then has 0 DOF.
My solution to animate the mechanism, which is not necessarily the best nor the only one, consists in creating a macro that will vary the value of this angle.
Here is the content of this macro:
Code: Select all
# -*- coding: utf-8 -*-
#DO NOT FORGET TO LOCK THE ANGLE
import time
# Movement go
angle = -20
for i in range(41):
FreeCAD.getDocument('Asm3_stepper_stepAP214').getObject('Constraint001').Angle = angle
Gui.runCommand('asm3CmdQuickSolve',0)
angle += 1
FreeCADGui.updateGui() # necessary to update the screen before each incrementation
time.sleep(0.001)
#Return movement
angle = 20
for i in range(41):
FreeCAD.getDocument('Asm3_stepper_stepAP214').getObject('Constraint001').Angle = angle
Gui.runCommand('asm3CmdQuickSolve',0)
angle -= 1
FreeCADGui.updateGui() # necessary to update the screen before each incrementation
time.sleep(0.001)
# Macro End ++++++++++
My website : http://help-freecad-jpg87.fr updated 2023/11/06
Re: Small example made with Asm3 WB from a * .step file
perfect! thanks a lot. exactly what i need.jpg87 wrote: ↑Mon Sep 07, 2020 12:07 pmHi Solarman,
The pilot mechanical link marked on the image (Join) leaves a rotating DOF between support 1 and pedal 2 :
Pilot mechanical link.png
After having set the Lock Angle parameter of the link to True, the value of the angle can then hijack the position of the mechanism which then has 0 DOF.
My solution to animate the mechanism, which is not necessarily the best nor the only one, consists in creating a macro that will vary the value of this angle.
Here is the content of this macro:Warning: the starting value angle = -20 of the macro must correspond to the value in the tree. Likewise for the return movement, check that the value given corresponds to the value reached in the forward movement.Code: Select all
# -*- coding: utf-8 -*- #DO NOT FORGET TO LOCK THE ANGLE import time # Movement go angle = -20 for i in range(41): FreeCAD.getDocument('Asm3_stepper_stepAP214').getObject('Constraint001').Angle = angle Gui.runCommand('asm3CmdQuickSolve',0) angle += 1 FreeCADGui.updateGui() # necessary to update the screen before each incrementation time.sleep(0.001) #Return movement angle = 20 for i in range(41): FreeCAD.getDocument('Asm3_stepper_stepAP214').getObject('Constraint001').Angle = angle Gui.runCommand('asm3CmdQuickSolve',0) angle -= 1 FreeCADGui.updateGui() # necessary to update the screen before each incrementation time.sleep(0.001) # Macro End ++++++++++
if you had a control function (linear, quadratic, etc.) for the change of angle/distance -unit per second (or frame), this could be the base for a constraint - keyframe animation for asm3 although i'm sure that Realthunder is more than just thinking about some animated constraints already.
Re: Small example made with Asm3 WB from a * .step file
that's easier than expected. by selecting the constraint object i see how to access the property.
import time
# Movement go
angle = 0
for i in range(45):
FreeCAD.getDocument('OffRoad_i2_2020_AL').getObject('Constraint013').Angle = angle
Gui.runCommand('asm3CmdQuickSolve',0)
angle += 1
FreeCADGui.updateGui() # necessary to update the screen before each incrementation
time.sleep(0.001)
is it possible to prevent the report view to pop up after each step? i put it on auto hide... maybe...
import time
# Movement go
angle = 0
for i in range(45):
FreeCAD.getDocument('OffRoad_i2_2020_AL').getObject('Constraint013').Angle = angle
Gui.runCommand('asm3CmdQuickSolve',0)
angle += 1
FreeCADGui.updateGui() # necessary to update the screen before each incrementation
time.sleep(0.001)
is it possible to prevent the report view to pop up after each step? i put it on auto hide... maybe...
Re: Small example made with Asm3 WB from a * .step file
Hi jpg87,jpg87 wrote: ↑Mon Sep 07, 2020 12:07 pmHi Solarman,
The pilot mechanical link marked on the image (Join) leaves a rotating DOF between support 1 and pedal 2 :
Pilot mechanical link.png
After having set the Lock Angle parameter of the link to True, the value of the angle can then hijack the position of the mechanism which then has 0 DOF.
My solution to animate the mechanism, which is not necessarily the best nor the only one, consists in creating a macro that will vary the value of this angle.
Here is the content of this macro:Warning: the starting value angle = -20 of the macro must correspond to the value in the tree. Likewise for the return movement, check that the value given corresponds to the value reached in the forward movement.Code: Select all
# -*- coding: utf-8 -*- #DO NOT FORGET TO LOCK THE ANGLE import time # Movement go angle = -20 for i in range(41): FreeCAD.getDocument('Asm3_stepper_stepAP214').getObject('Constraint001').Angle = angle Gui.runCommand('asm3CmdQuickSolve',0) angle += 1 FreeCADGui.updateGui() # necessary to update the screen before each incrementation time.sleep(0.001) #Return movement angle = 20 for i in range(41): FreeCAD.getDocument('Asm3_stepper_stepAP214').getObject('Constraint001').Angle = angle Gui.runCommand('asm3CmdQuickSolve',0) angle -= 1 FreeCADGui.updateGui() # necessary to update the screen before each incrementation time.sleep(0.001) # Macro End ++++++++++
thx a lot! /https://www.dropbox.com/s/imrv23x1mkanj ... L.m4v?dl=0
Re: Small example made with Asm3 WB from a * .step file
Hi, I was glad I could help you.
Nice work in FreeCAD and Asm3 and above all very nice project!
Nice work in FreeCAD and Asm3 and above all very nice project!
My website : http://help-freecad-jpg87.fr updated 2023/11/06