Possible to set a zone partition constraint to use FlexScript?

Possible to set a zone partition constraint to use FlexScript?

axel_kohonen
Not applicable
45 Views
7 Replies
Message 1 of 8

Possible to set a zone partition constraint to use FlexScript?

axel_kohonen
Not applicable

[ FlexSim 17.2.5 ]

Hi,

I would like to set a Zone partition constraint to use different values depending on the partition that we are in. It is possible using the exception rows as in the image below. However, the values are fixed. Is it possible to make them into FlexScript so that one could use e.g. a value defined in a macro as with the main limit?

Or would it be possible to get the token/partition already in the limit code so that one could write the exception rules there?

Thank you!

Kind regards,

Axel

12027-partitionconstraints.png

0 Likes
Accepted solutions (1)
46 Views
7 Replies
Replies (7)
Message 2 of 8

Matthew_Gillespie
Autodesk
Autodesk

@jordan.johnson



Matthew Gillespie
FlexSim Software Developer

0 Likes
Message 3 of 8

JordanLJohnson
Autodesk
Autodesk
Accepted solution

For now, if you want to get a macro to return its value, you should use parenthesis:

(MY_MACRO)

The check for code checks for parenthesis. Maybe that will change someday, but that will work for now.

testmacro.fsm

.


Jordan Johnson
Principal Software Engineer
>

Message 4 of 8

axel_kohonen
Not applicable

Hi @jordan.johnson

Great! That works in this case. Do you have any plans on making the constraints FlexScript?

Thank you!

0 Likes
Message 5 of 8

JordanLJohnson
Autodesk
Autodesk

It is FlexScript. The parenthesis are how I check if the node should be compiled as FlexScript.

.


Jordan Johnson
Principal Software Engineer
>

Message 6 of 8

axel_kohonen
Not applicable

Hi @jordan.johnson

I tried to use the parenthesis trick to use a macro to define the name of the partition, but that does not seem to work, regardless if I add the "/" which FlexSim seems to add if I write the partition name directly.

Is it possible to use a macro in the partition name field or only for the limit value?

Thank you!

0 Likes
Message 7 of 8

JordanLJohnson
Autodesk
Autodesk

It should be possible, can you post an example model where it's not working?

.


Jordan Johnson
Principal Software Engineer
>

0 Likes
Message 8 of 8

axel_kohonen
Not applicable

Hi @jordan.johnson

Thank you. It does work. My mistake was that I partitioned not by the object name, but by objects themselves. And then tried to check use an exception with the name of the object, which obviously fails.

0 Likes