How to get an object's reset position using code

How to get an object's reset position using code

jon_abbott
Not applicable
9 Views
2 Replies
Message 1 of 3

How to get an object's reset position using code

jon_abbott
Not applicable

[ FlexSim 20.0.0 ]

I would like to get the reset position for an object using code, but I don't see a "getresetposition" command. Is there a shorter (and/or more elegant) way to do this than the following code?

[getvarnode(Model.find("Object1"), "resetposition").subnodes[1].value, getvarnode(Model.find("Object1"), "resetposition").subnodes[2].value, getvarnode(Model.find("Object1"), "resetposition").subnodes[3].value]

Thanks in advance for any assistance you can provide.

Accepted solutions (1)
10 Views
2 Replies
Replies (2)
Message 2 of 3

Matthew_Gillespie
Autodesk
Autodesk
Accepted solution

There's no getresetposition() command. This is the code I would use:

treenode object = Model.find("Object1");
var pos = getvarnode(object, "resetposition").subnodes;
return [pos[1].value, pos[2].value, pos[3].value];


Matthew Gillespie
FlexSim Software Developer

Message 3 of 3

jon_abbott
Not applicable

Thanks @Matthew Gillespie! This works, and I've made it into a user command getresetposition.fsl that I've attached. I'll also send a request to dev@flexsim to consider adding getresetposition() and/or Object.resetposition to FlexSim.