On/Off-differentiation in Macro

Dear AnyBody,

I have a question concerning the macro-function.

I have found, that using a command like: load “Demo.Arm2D.any” -def N_STEP=“10” enables the user to define variables in the macro.
In my case, not only variables have to be defined. I have the following differentiation in my file:

#define MOTION_CAPTURE ON

#if MOTION_CAPTURE == ON

#else

#endif

Now I want to declare in the macro, whether MOTION_CAPTURE is ON or OFF. My question is: How can this be done?

Thank you very much,
Kilian

Hi Kilian,

ON/OFF are just synonyms for 1/0 (used for the code readability)

On:

 load "Demo.Arm2D.any" -def N_STEP="10" -def MOTION_CAPTURE="1" 

Off:

 load "Demo.Arm2D.any" -def N_STEP="10" -def MOTION_CAPTURE="0" 

The definition of a string define varies a little (if you need one):


load "Demo.Arm2D.any" -def N_STEP="10" -def SOMESTRING=---"\"TEST\""

Best regards,
Pavel