Login  Register

Re: API or similar tools for LibreCAD

Posted by LordOfBikes on May 30, 2020; 9:32am
URL: https://forum.librecad.org/Help-to-develop-define-new-command-tp5719001p5719014.html

@VyasG_007, I moved your post here as it is direct related with this thread.

So I understood now that you need help to get changes from source code into the application.
This is a bit too much to handle here, I'll give you some hints, but maybe you should start with some HelloWorld C++ tutorial for a better understanding.

When you change a config file like LibreCAD's command aliases, then this file is read by the binary LibreCAD application and a restart of the application is enough.

But when you change any source code file, you have to create a new binary application from the source code. This requires a tool chain with at least a compiler and linker and often some other tools like make, which automatizes a part of the build process.
Additionally external libraries are used, which brings in ready to use functionality.
To make things not too easy, everything depends on your operating system too.

So how to create the binary application from source is explained here:
https://librecad.readthedocs.io/en/latest/appx/build.html
You can try to follow these instructions and see if it works for you.

Concerning your API question:
Qt is an application frame work which makes GUI programming easier, some installer for Windows even contain the compiler/linker tool chain.
muparser is a library we use for command parsing
and boost is a multiple purpose C++ extension library

Basically Plugins are the easy API to extend LibreCAD without knowing much about the internal work flow.
They have to be written in C++ too and have a interface to interact with the active drawing.
This interface allows to add, modify or delete entities to the active document.
Existing plugins are in the plugins folder of the source code.

Find more information about LibreCAD development here (follow the links):
https://dokuwiki.librecad.org/doku.php/community:developer

At least, when you consider to put more efforts into this, git is a must have too.
investing less than half an hour into Search function can save hours or days of waiting for a solution