Posted by
Goran on
Apr 01, 2025; 6:24pm
URL: https://forum.librecad.org/Pseudo-scripting-with-excel-add-layer-tp5726798p5726818.html
sand1024 wrote
....And what is the main purpose of the "last"....
"last" - mean select last entity - line, polyline etc.... yes, it's useful for copy in first place, but you can, for example, insert block reference, and run script -> select last block entity, copy on desired position, select last and rotate, select last and.....do something else what you need.
sand1024 wrote
> ...if I'm correct - the "move" command you've described - is just an option to specify the array, right? ...<
"Yes, I think this command has all the prerequisites to be used for "array". In my opinion, it would only be necessary to adjust the call, that is, the way it can be called from the command line or from a script."
sand1024 wrote
>I've also considering something like setting variables in script and referring them as part of command attributes...<
What just came to mind is something that might be handy for non-programmers like me. Is it possible to create reserved variables at the project file level, named like var1, var2, var3, ..., var99? These variables would be used for interaction between a script and the current drawing/draft.
Example:
I want to draw a rectangle using a script by selecting two points that are opposite corners of the rectangle. Variables var1 and var2 would store the (x, y) coordinates of the first corner, and var3 and var4 would store the (x, y) coordinates of the opposite corner. Additionally, var3 could, for example, represent an offset for an inner rectangle, which I could set by typing a value into the command line.
Is something like this even possible? Please be gentle—keep in mind you’re talking to someone who isn’t a programmer. My questions might be unrealistic! 😊
Best regards, Goran