question

Shinya O avatar image
0 Likes"
Shinya O asked Joerg Vogel commented

How to get the information on the pathPoints subnode as string

I'm trying to get the information on the following treenode:

MODEL:/AGVNetwork/StraightPath1>variables/pathPoints/1


In this file, I have got the output like a following image.

image.png

As you can see in this photo, the cast to string does not work.

I want to treat the information as string.

sample_pathpoints.fsm

Thanks!

FlexSim 21.1.0
agvnetworktreenodecast
image.png (115.8 KiB)
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

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Joerg Vogel commented

Do you only want to get the path inside the node or also the "distAlong" and "fromToTableRow" values?

To get the path as a string you can follow it to the node it is pointing to and then use "getPath()" on it.

treenode cp_Node = node.find(">variables/pathPoints/1+");
Variant pathpoint1_fromnode = cp_Node.getPath(model());  
//model() to get the same as in the link, otherwise "MODEL:" is added in front

To get the other values in the node, you can use "getsdtvalue()". Forward-compatability to future FlexSim versions is not guaranteed though, as variable names might change.

sample-pathpoints_1.fsm


· 2
5 |100000

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

Shinya O avatar image Shinya O commented ·

I want to get only the path as string. Your answer is exactly what I want.

Thank you.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel commented ·
Traversing the tree here the plus sign in the path string
0 Likes 0 ·