Help to develop / define new command

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

Help to develop / define new command

MrCAD
Need help from developers for the highlighted command (in Red) !!

Also LOOK OUT the source code which I edited in rs_commands.cpp, need to know how to execute the same in software.

 


P.S. Into the code which I edited (Red rectangular highlight), on second line (short form of untranslated command) ttr stands for Tangent To/Two Radius
Reply | Threaded
Open this post in threaded view
|

Re: Help to develop / define new command

LordOfBikes
Administrator
It is not clear to me, what kind of help you need.
What do you mean with how to execute the same in software?

Basically your changes look fine, they should build without issues.

I recommend to use "ct2" instead of "ttr" as alias.
This is more conform with the "ct3" alias in the lines below your changes.
Or do you have strong arguments for "ttr"?

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: Help to develop / define new command

MrCAD
I want to define a new command in alias for 'Tangential 2 Circles, Radius' (see tiny screenshot of previous comment), which is not included into 'librecad-alias'.

I meant by saying, "How to execute into the software" is that, Will the editing into rs_commands.cpp as shown in previous screenshot, by just click on 'save' and it (the new defined command of Tangential 2 Circles, Radius) will work as 'new command shortcut' along with the edit into the 'librecad-alias' too by just restart the LibreCAD??

And yes, what I define(for my comfort only) for 'Tangential 2 Circles, Radius' is ttr, because basically the circle making a radius will tangent to Two object (not only circles). However, I have no issues with 'ct2' either. ttr is just for fast typing (again, for my comfort).

I am bit lazy to type, C, and T, and then 2 by climbing keyboard's rows, (just imagine, ttr, how fast it is).
ACL
Reply | Threaded
Open this post in threaded view
|

Re: Help to develop / define new command

ACL
I think the rs_commands file should have a standardized command and shortcut in it, and your personal preference for the alias should be in your aliases file. A lot of commands need to be entered into rs_commands.
Reply | Threaded
Open this post in threaded view
|

API or similar tools for LibreCAD

MrCAD
In reply to this post by MrCAD
Software like AutoCAD has API to customize and develop plugins or any new feature for the same.

What tools do I need to create or edit/modify existing commands? I have seen on the website that it needs Qt, muparser, and boost. Are they similar to APIs of Autodesk's AutoCAD.

Does LibreCAD have an API (Application Programming Interface)? If not, what are the alternatives to CUSTOMIZE LibreCAD?

Reply | Threaded
Open this post in threaded view
|

Re: API or similar tools for LibreCAD

flywire
Are you aware https://github.com/LibreCAD/LibreCAD_3 is being developed? If you are interested in development goto https://librecad.zulipchat.com/login/ and discuss it with the devs.
Reply | Threaded
Open this post in threaded view
|

Re: API or similar tools for LibreCAD

LordOfBikes
Administrator
@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
Reply | Threaded
Open this post in threaded view
|

Re: API or similar tools for LibreCAD

MrCAD
In reply to this post by flywire
@flywire I am happy to help and willing to join discussion but I am not a IT professional (developer or programmer), I am a Mechanical Engineer, so I may not help with Coding related discussion but I can help with 'what kind of feature or command should be'.

However, I am finding the best source to Learn C++ online for CAD CUSTOMIZATION which I can use for my projects and contribute here to the community (after sufficient experience with C++ programming).
Reply | Threaded
Open this post in threaded view
|

Re: API or similar tools for LibreCAD

MrCAD
In reply to this post by LordOfBikes
@LordOfBikes thank you for sharing in-detail information about Qt, muparser and boost, this is very helpful.

I will learn C++ for LibreCAD development and will contribute for the same.