DesignVar and Set Value

Hi !
I’m still working with macros but I"m unable to find the right way to set a value.

Here is the context : I’d like to set the value of the “tEnd” parameter via a macro command, to launch the stud with the Anybodycon program.

I set this parameter in my “main” file as follows (I use the Demo.Arm.2D.any file) :

  
AnyBodyStudy Study = {
    AnyFolder& Model = Main.ArmModel;
    Gravity = {0,0,-9.81};
    nStep =N_STEP;
    tEnd = DesignVar(1);
}; 

Then, here is my macro commands :


load "../Demo.Arm2D.any" -v --tEnd=30

But (of course :wink: ) it’s wrong since I get this error : "Warning : arguments has no effect : -v --tEnd = 30 "

Can you help me and give me advice about that specific problem ?

Thank you in advance !
Lauranne

Hi Lauranne

The values that are “Editable” in the gui can be set/changed after the load command. The macro command is called 'classoperation, and your macro should looks like this:


load "Knee.any"
classoperation Main.MyStudy.tEnd "Set Value" --value="0.5"
operation Main.MyStudy.InverseDynamics
run
exit

Hope it helps you
/Morten

Hi Morten !
Sooooooo great !
Thank you !

L.