question

Ralf Gruber avatar image
1 Like"
Ralf Gruber asked Matthew Gillespie answered

Possible createcopy() - bug?

Hi guys,

I tried to copy the labels node from a Token into a FlowItem to easily copy all labels at once:

treenode TokenLabels = Token.labels;
treenode ItemLabels = item.labels;
createcopy(TokenLabels, ItemLabels, 1,0,0,1);

with Token being a reference to a token and item being a reference to a FlowItem. Unfortunately this does not work. It works perfectly when copying from one FlowItem to another, but not, if the origin node is on a Token. This part of the user manual suggests, that the labels node on a Token works the same as in treenodes:

Token.labels

readonly labels

Description

Accesses a node's labels as nodes.

Works just like labels on treenodes.

So I would expect the createcopy() command to work. What am I doing wrong?

Thanks
Ralf

FlexSim 20.0.1
labelscreatecopycopy labels
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

·
Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered

Tokens don't allow you direct access to their labels node - you'll get an error if you try to get the path of labels(token). Tokens don't even let you get a label by rank. This is because labels on tokens can be much more complicated. They don't always store all of their own labels, many of them are stored on parent tokens.

So maybe the documentation is a little simplistic. You can use the token.labels property mostly like you would the treenode.labels, but you can't have access to the labels node itself and you can't access labels by rank.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.