LDCad Lua - prompt and wait for selection?


RE: Lua - prompt and wait for selection?
#20
Quote:If you, or anyone else, has some additional ideas on api extensions please let me know.


Hi Roland,

I was wondering whether there is any ability to pass arguments to the LDCad Lua script?

Let's say the sub-model scripting source file is defined as:


Code:
<path-to-lua-script>\argv.lua

with (trivial example) the Lua script argv.lua looking like:


Code:
print('#arg = ' .. tostring (#argv))
for i_li = 1, #arg do
  print(tostring(i_li) .. ' : ' .. arg[i_li])
end


Is there any way to supply arguments to the script? e.g. define the sub-model scripting source file as:

Code:
<path-to-lua-script>\argv.lua abc

I tried the above approach but it was unsuccessful so I thought I would check before going any further.

If it can't be done, is it something that could be added? I can see some use for it to pass values to scripts to alter their behaviour e.g. for the linkage animation script, passing the axis around which to rotate the sub-file as a parameter rather than requiring the user to set it when the file is opened.

Regards,

David
Reply
« Next Oldest | Next Newest »



Messages In This Thread
RE: Lua - prompt and wait for selection? - by David Manley - 2021-12-15, 0:23

Forum Jump:


Users browsing this thread: 1 Guest(s)