Hi Lauranne,
I tried to reproduce your current problem.
-
I can see that in version 5.1 there is a problem with the define statement that it has no effect. This is probably a bug, sorry for that, but it is fixed in AMS 5.2
-
For AMS 5.2: I tried the define statements using a small test example based on Demo.Arm2D.any from the demo examples in the reference manual of AnyBody. I added two define statements at the top of the file (I hope) similar to your define statements:
#ifndef N_STEP
#define N_STEP 10
#endif
#ifndef Name
#define Name "Output.anydata.h5"
#endif
To see the effect of the Name, I simply added a class operation that saves the output and wrote it into an AnyOperationSequence, similar to definitions that can be found in AMMR models
Main = {
AnyOperationSequence RunApplication =
{
AnyOperation &Inverse = Main.ArmModelStudy.InverseDynamics;
AnyOperationMacro output =
{
MacroStr = {"classoperation Main.ArmModelStudy.Output " + strquote("Save data") + "--type=Deep --file=" + strquote(Name)};
};
};
...
};
To test the effect of the N_STEP define statement, I added used it to define the number of steps in the Study which now looks like this:
AnyBodyStudy ArmModelStudy = {
AnyFolder& Model = Main.ArmModel;
Gravity = {0,0,-9.81};
nStep = N_STEP;
};
With this example I was able to
a) define a statement in an .anymcr file like using the syntax
load "Demo.Arm2D.any" -def N_STEP=10 -def Name=---"\"OuptutfileNameMatlab.anydata.h5\""
operation RunApplication
run
exit
which is then called without arguments on the command line. Please note that in this example the Name has to end with .anydata.h5, which is a requirement for the classoperation. I guess what could have been a problem is the quotation of the second define statement. As a reference, the syntax of quotation is mentioned in the release note to AMS 5.2.
b) Otherwise it is possible to define these statements on the commandline by deleting the -def statements from the .anymcr file (if they are still in, the -def statements from the commandline are overwritten)
The call of AnyBodyCon is then
AnyBodyCon.exe /m macrofile.anymcr /def N_STEP=10 /def Name=---"\"OuptutfileNameMatlab.anydata.h5\""
I think in this case it does not make a difference if there are quotes around the 10.
I hope this works also for your problem.
Best regards
Daniel