QCAD source code learning

Drop in here to discuss whatever you want.

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files and screenshots.

Post one question per topic.

Post Reply
WildWolfCJ
Full Member
Posts: 84
Joined: Fri Oct 20, 2023 7:21 am

QCAD source code learning

Post by WildWolfCJ » Sun Oct 22, 2023 5:48 am

I am reading the source code of QCAD and want to find the algorithm code for the corresponding explode function? Is this algorithm implemented in JS?

CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Re: QCAD source code learning

Post by CVH » Sun Oct 22, 2023 8:21 am

For the GUI Modify .. Explode (XP) method:
Yes.
https://github.com/qcad/qcad/tree/maste ... fy/Explode
https://github.com/qcad/qcad/blob/maste ... Explode.js
In a standard installation this available in compiled form.

For the dwgexplode functionality:
Yes, but that is not open source.
Probably this makes a selection in an offscreen document and then calls Explode.explodeSelection(di) before saving it as a new file.

Regards,
CVH

WildWolfCJ
Full Member
Posts: 84
Joined: Fri Oct 20, 2023 7:21 am

Re: QCAD source code learning

Post by WildWolfCJ » Mon Oct 23, 2023 3:13 am

The QCAD installer packages JS files into resources, so which file should these resources be placed in?

WildWolfCJ
Full Member
Posts: 84
Joined: Fri Oct 20, 2023 7:21 am

Re: QCAD source code learning

Post by WildWolfCJ » Mon Oct 23, 2023 3:50 am

CVH wrote:
Sun Oct 22, 2023 8:21 am
For the GUI Modify .. Explode (XP) method:
Yes.
https://github.com/qcad/qcad/tree/maste ... fy/Explode
https://github.com/qcad/qcad/blob/maste ... Explode.js
In a standard installation this available in compiled form.

For the dwgexplode functionality:
Yes, but that is not open source.
Probably this makes a selection in an offscreen document and then calls Explode.explodeSelection(di) before saving it as a new file.

Regards,
CVH
The QCAD installer packages JS files into resources, so which file should these resources be placed in?

CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Re: QCAD source code learning

Post by CVH » Mon Oct 23, 2023 7:25 am

I see no reason to ask the same question twice within 47 minutes, with or without a quote. :wink:
WildWolfCJ wrote:
Mon Oct 23, 2023 3:13 am
The QCAD installer packages JS files into resources, so which file should these resources be placed in?
I'm having trouble understanding the gist of the question.
The QCAD installer doesn't package, it installs a pre-packaged OS dedicated content.
JS files are resources, other resources are and may be written in C++.
Refer to: https://www.qcad.org/doc/qcad/latest/developer/

Where JS file resides can be seen in the QCAD application .. Help .. About .. Scripts.
This is not rocket science. :wink:
e.g. Block.js is located in folder .../QCAD/scripts/Block/Block.js where .../QCAD stand for your QCAD installation folder.
Notice the class name and the matching folder name.
Similar as all other here: https://github.com/qcad/qcad/tree/master/scripts

Remind that in a standard installation these are included in compiled form.
One can supersede standard compiled scripts by including them under the scripts folder given this convention.
Or under the scripts folder of your user data location.

If this doesn't answers your question then please rephrase your question with more details.
May I include that all this information is readily available on the QCAD site.
May I also repeat that updating QCAD is the easiest way to include dwgexplode.

Regards,
CVH

Post Reply

Return to “Chat”