0 votes
I use a READXML box to get elements from an XML file. Now I want to read them one by one with a LUA script. How I can do that.
asked May 10, 2017 in Lua Scripting by jc2833 (160 points) | 10 views

1 Answer

0 votes

If you want to read a vector in a lua script, use the myVector:at(index) function.

See the https://wiki.realmotion.com/RMWiki/index.php?title=Lua_-_Vector for the vector documentation.

And be aware of: “NOTE: All RM Vectors use 0-based indexing. Lua arrays use 1-base indexing.”

RM Vectors are vectors created to interface with RealMotion. They are non-native to Lua, which starts at 1.

Alternatively, maybe the only thing you need is the box Get Item to retrieve any item of a vector.

answered May 10, 2017 by Louis-Philippe Bell (440 points)
Before asking a question, please make sure it is not already asked by somebody else. You can also check the Wiki for the boxes documentations and user guides.