How Can I Use PRO Scripts in My own Script

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
ilyasozkurt
Newbie Member
Posts: 9
Joined: Sat Nov 19, 2022 3:20 pm

How Can I Use PRO Scripts in My own Script

Post by ilyasozkurt » Sat Nov 19, 2022 3:22 pm

Hello there,

I'm trying to build my own scripts. But I could not find the guide for using the pro scripts inside my scripts. Is there a way to do it? Using the commands inside my scripts is also okay for me.

I mean, select all, then run the "is" command, and give me the result is a good example of what I'm trying to do.

Thank you so much.

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

Re: How Can I Use PRO Scripts in My own Script

Post by CVH » Sat Nov 19, 2022 9:07 pm

Hi,

Same answers as here:
https://www.qcad.org/rsforum/viewtopic. ... 016#p39016

If not provided by Andrew there is not much to go on.

What you want is TA + IS ...
... Would a script that sums the length of a selection do it for you?

TA is basically the same as:
var di = EAction.getDocumentInterface();
di.selectAll();


Querying the selected is by:
var doc = di.getDocument();
var ids = doc.querySelectedEntities();


Now it is the question to cycle through ids and sum the entities their length.

Best is that you check for and perhaps limit entities by type.
The selection can include Dimensions, Blocks, Images, Hatches or Viewports and so on.

Best is to verify that the getLength() function exist for that entity and/or that it returns a valid number.

Regards,
CVH

ilyasozkurt
Newbie Member
Posts: 9
Joined: Sat Nov 19, 2022 3:20 pm

Re: How Can I Use PRO Scripts in My own Script

Post by ilyasozkurt » Sat Nov 19, 2022 11:56 pm

Thank you so much. It's still a bit hard to explore other plugin sources. I mean the Pro ones. We should create a complete reference of it for Professional version.

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

Re: How Can I Use PRO Scripts in My own Script

Post by CVH » Mon Nov 21, 2022 10:32 am

ilyasozkurt wrote:
Sat Nov 19, 2022 11:56 pm
We should create a complete reference of it for Professional version.
The meaning of 'proprietary' should be clear here.
They are not Open Source and there is no public overview or reference for them.

You can refer to Help > About... Plugins and/or Scripts.

Regards,
CVH

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”