Can token labels be accessed via numeric index?

martin_jensen
Not applicable
0 Views
1 Reply
Message 1 of 2

Can token labels be accessed via numeric index?

martin_jensen
Not applicable

[ FlexSim 16.1.2 ]

I am attempting to optimize the speed of my process flows and my code in general and have therefore decided to use direct adresseing on labels as much as possible. I have created macros to adress labels on my objects by index rather by name, but when I try to do the same thing on a Process Flow token it fails.

Am I correct in assuming that getlabel cannot use the labels index when accessing it on a token? Why is that?

getlabel(token, numeric_Label_Index);    vs.    getlabel(token, "MyLabel");
Accepted solutions (1)
1 View
1 Reply
Reply (1)
Message 2 of 2

brandon_peterson6BCRW
Autodesk
Autodesk
Accepted solution

Martin,

The answer is both yes and no. If you are using getlabel() on a flowitem, resource, or task executer then the answer is "yes". If you are using it on a token then the answer is "no". I do not know the reason for this but I would guess that it is do to how tokens access labels. The parent/child relationship that tokens are capable of introduces a number of complications that would make the numeric reference for a label unreliable.

I hope this clears things up for you,

Brandon

img src="https://damassets.autodesk.net/content/dam/autodesk/logos/autodesk-logo-primary-rgbblack-small_forum.png" >

Brandon Peterson
Principal Technology Consultant
>