question

Jon Abbott avatar image
2 Likes"
Jon Abbott asked Jon Abbott edited

How to get an object's reset position using code

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?

  1. [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.

FlexSim 20.0.0
flexscriptcodeobjectreset position
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 Jon Abbott edited

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

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

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