Thread: "IF.." function
View Single Post
Old 03-19-2009, 02:57 PM
AnyScript Support
Posts: n/a
Default RE: [AnyScript] "IF.." function

Hi Naoko,

The AnyFunIf can be used. Please see the reference manual for the details of
use. With this function you can for example compare values of variable and
output a certain object according to this comparison.

There is now a second type of IF statement recently implemented in the
version 3.1 of anybody. This one allows you to activate or desactivate a
whole piece of code in the model. The syntax is the following:

#define GlobalVariable 1

// the system identify Globalvariable as being equal to 1

// it can be set to 0 or whatever value to activte and disactivate the if

#if GlobalVariable == 1

// here is the piece of code to be activated if true


// here is the piece of code to be activated if false


This example is a simple 0 - 1 switch but it can be extended.

Best regards,

Sylvain, AnyBody Support


From: [] On Behalf
Of naoko.blanca
Sent: 19. marts 2009 06:49
Subject: [AnyScript] "IF.." function

Dear Support,


I would like to know about "IF .. then .. else .. " function.
Many programming languages have "IF.." function.
If it exists in AnyScript, we can give the models different move or
different power according to the situation.

For example, "arm2d.any" in tutorial/StudyOfStudies,

1) According to the angle of Elbow , "Main.ArmModel.Muscles.MusMdl.F0"
2) According to the angle of Elbow , "Main.ArmModel.Loads.Dumbbell.F"

I know, when I use external text files as angles of Elbow , F0 and F, I
might be able to do it in some case.
But if "IF.." function exists, it is more convenient.

And there described about "AnyFunIf" function in AnyScript Reference Manual,
and it is "Hidden" type.
Is it possible to use ?

Thank you.


[Non-text portions of this message have been removed]