Set Spatial attributes with C++

Set Spatial attributes with C++

sergio_v6
Not applicable
412 Views
2 Replies
Message 1 of 3

Set Spatial attributes with C++

sergio_v6
Not applicable

[ FlexSim 21.0.2 ]


Hello.

I'm trying to set the spatial attributes of an object using c++ code, i can access the treenode and change the name, but i don't know how to change these values. how i can do it?


1625775149729.png1625775133630.png


0 Likes
Accepted solutions (1)
413 Views
2 Replies
Replies (2)
Message 2 of 3

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

The setLocation method is on the ObjectDataType class, so you have to cast the treenode to ObjectDataType:

obj->objectAs(ObjectDataType)->setLocation(0, 0, 0);

Alternatively you can use the setloc() command which just takes a treenode:

setloc(obj, 0, 0, 0);


Matthew Gillespie
FlexSim Software Developer

Message 3 of 3

sergio_v6
Not applicable
It Worked, thank you!
0 Likes