(2021-08-12, 11:52)Milan Vančura Wrote: One question about scripting:
I got an idea lua scripts might help me with copying groups with their pivot point kept. And while looking around for LDCAD scripting examples, I found methods not mentioned on your Scripting API web page. Probably because lua in LDCAD evolved since the documentation was written. But what surprised me was that I could not get the list of methods by simple dump function. Are ldc objects somehow special? Or is the dump function too basic?
(I'm sorry I'm lua greenhorn, I just try to learn as I use it.)
That script only lists the 'static' functions, ldc.vector() etc returns lua 'user data' which has its own set of functions.
That said the current lua interface is 99% readonly oriented, so you can't copy groups as you currently can't create groups using pure script.
The documentation is ancient (~version 1.4), I've been working on updating it but its boring and therefor slowly progressing
![Smile Smile](https://forums.ldraw.org/images/smilies/smile.png)
I've uploaded the part I already done, as it might be somewhat helpful.
http://www.melkert.net/LDCad/docs/scriptAPI2
Don't mind the 150 or so "todo's"
![Big Grin Big Grin](https://forums.ldraw.org/images/smilies/biggrin.png)
Please note there are some Alpha 2 things (input/control/etc) in there not available in 1.6/alpha1