I'm making a lot of precedural drawing and I'm using LibreCAD mostly in command mode, with a lot of commands generated from another program.
At first I used to copy-paste but it was a lot of work.
I'm currently using xdotool to submit my generated commands through the GUI.
This must be kept very slow to keep it reliable but at least it's an automated process.
I think it would be great if there was some sort of pipe to send commands to LibreCAD from another program.
maybe a named pipe or a TCP socket.
I think the named pipe would be very easy to implement although it may be limited to the linux/posix version
1) Use LibreCAD 2 and create a plugin. This allows you to create a little GUI around your process but obviously it's not that versatile
2) Use LibreCAD 3 + Lua to create DXF drawings from command line. This is sorta your pipeline solution. Exception you use LibreCAD in a scripted situation from command line (a GUI is also possible in this case though...). However LibreCAD 3 is not stable yet, but I am pretty sure it will be stable enough for your procedural drawings.
this is nice but the plugin API does not seem able to interact with the commandline box but directly with the document.
so, I have to recreate the command parser and call the drawing methods directly...
Another problem is that the plugin is designed to be executed by the user as a procedure. it is not made to wait for incoming orders.
in fact it is quite odd to have a command line that is not designed to be connected to some data stream that could be a file, a terminal or a command generator. At first, I was expecting librecad would read stdin the very same way it reads the command line box.
yes that's correct and I figured already that was properly not a good option for yuu.
Perhaps the lua route would be better for you? Although when using Lua you cannot really stream values into LibreCAD, you can get thing's executed in a specific order and generate your DXF including read from command line.
I've read some c++ code from librecad's github but i'm not familiar with Qt and its way to handle the GUI events.
i was thinking about reading stdin or a named pipe in the big main loop and then to feed it to the cmdline interpreter but it do not seems so trivial.
about librecad3. I do not understand Lua. It seems quite different from the languages I'm used to and I have no time to invest in learning it now.