bambuko wrote: ↑Sun Apr 11, 2021 12:44 pm
1) how do you save modified macro? ...
To save the modified macro, the macro file must be active (just after a write), then the FreeCAD File / Save command applies to this file. If we are in the classic FreeCAD screen (tree, 3D view, etc.), the FreeCAD file (eg the assembly) is saved.
According to my tests, when you run the macro, it takes into account the last modifications made, even if it was not saved.
bambuko wrote: ↑Sun Apr 11, 2021 12:44 pm
2) when I modify the value of "angle" in line 17 ...
In this example, the Angle variable has the value 0 in the macro, and in the properties of the constraint the value of the angle is also 0.
After running the macro, the angle has reached the value of -360 ° in the properties of the constraint, so one turn.
He therefore visually regained his starting position. If we run the macro again, visually there will be no difference.
bambuko wrote: ↑Sun Apr 11, 2021 12:44 pm
3) you are saying: ...
If the amplitude of the displacement caused by the execution of the macro is not exactly equal to one revolution, when the macro is launched, you will see the system "jump" from the last position reached during the previous execution to the first. position caused by the new execution of the macro (... if there is no blocking or malfunction!).
Experiment by changing for example line 18 by
for i in range (46):
To reinitialize, at the end of the execution of the macro, it is necessary to click on the value reached by the angle in the properties of the pilot constraint to the initial value given line 17 in the macro.
Note, if the pilot constraint is selected in the tree at the time of the execution of the macro, you will see in the properties of this constraint the angle evolving from its starting position to its end position.
bambuko wrote: ↑Sun Apr 11, 2021 12:44 pm
4) Why is the angle at Property set at -360deg when macro specifies 0deg ?
Line 21 of the macro:
angle - = 2
means an increment of 2 ° between two displayed images, negative direction.
To reverse the direction, you have to type instead
angle + = 2
You can change the numeric value of the increment.
The change of - = in + = reverses the direction well, but to foresee it in advance supposes to know exactly how the coordinate system is oriented for the pilot constraint. I just do a test to see in which direction the movement takes place (here I had chosen the forward movement of the loco).
Note: I am using Google translate to send you my remarks in English, maybe some translation details are escaping me !