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.
How Can I Use PRO Scripts in My own Script
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
-
- Newbie Member
- Posts: 9
- Joined: Sat Nov 19, 2022 3:20 pm
Re: How Can I Use PRO Scripts in My own Script
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
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
-
- Newbie Member
- Posts: 9
- Joined: Sat Nov 19, 2022 3:20 pm
Re: How Can I Use PRO Scripts in My own Script
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.
Re: How Can I Use PRO Scripts in My own Script
The meaning of 'proprietary' should be clear here.ilyasozkurt wrote: ↑Sat Nov 19, 2022 11:56 pmWe should create a complete reference of it for Professional version.
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