drawing a pattern of object as a function of its position

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

drawing a pattern of object as a function of its position

tetukowski
Hi all,
First of all, i'm pleased to see the final release r2.20.
Which for me as a user means that libreCAD is still alive.
I'm very thankful for that!

I have never done this before (even in AutoCAD), i don't know if doable.
I want to draw thousands  or more of objects in a rectangular pattern.
but each objects has some feature that depends on its position.
for example, if an angle of a line in an object is called "alpha",
then, mathematically speaking , alpha = f(x,y).
for small number of x, y, manually is still possible.
but i have around >10k of positions.

is there a way to do this?
It seems it needs scripting, is it possible to somehow use python?
I saw old docs of LibreCAD 3 Lua scripting, but I'm not sure and i don't know Lua.

thank you very much.
best regards,
teko
Reply | Threaded
Open this post in threaded view
|

Re: drawing a pattern of object as a function of its position

LordOfBikes
Administrator
Lua is available in LibreCAD 3, but it is still not in a productive state.

Have a look at this pseudo-scripting article in the wiki:
https://wiki.librecad.org/index.php?title=Pseudo-Scripting_With_Excel

It uses the command file feature in 2.2. A command file is a simple text file with valid command line commands, separated by a semicolon.
The article uses spreadsheet software to create the script file, but when you are comfortable with Python, this will surely work too.

I'm not sure if anybody has ever tested this feature with tens of thousands of commands.
But if there are any limits, you can create multiple command files and execute them all in one drawing.

Armin
investing less than half an hour into Search function can save hours or days of waiting for a solution
Reply | Threaded
Open this post in threaded view
|

Re: drawing a pattern of object as a function of its position

tetukowski
Hi Armin,

Thank you for your reply (It is always you!).
I will try it.

I also saw this open issue:
https://github.com/LibreCAD/LibreCAD/issues/256#issuecomment-536165637

It would be nice if this feature would be in the future version.
I wonder how difficult it is to make such a thing; I'm not sure how to call it (a python wrapper?).

Tetuko