dwgexplode 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
WildWolfCJ
Full Member
Posts: 89
Joined: Fri Oct 20, 2023 7:21 am

dwgexplode script

Post by WildWolfCJ » Thu Aug 28, 2025 8:03 am

When using the dwgexplode script, can I specify multiple element handles to explode?

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

Re: dwgexplode script

Post by CVH » Thu Aug 28, 2025 2:27 pm

Hi,

dwgexplode is geared to explode all complex entities.

The limiting switch works as the inverse of what you aim for ...
... Specify what not to explode and exclude the required type from this list.

An example command is given that explodes all except texts and polylines.
Add ",Block Reference,Spline,Solid,Hatch" and so on.

It only concerns all visible drawing entities in the model.
Textual entity types in the switch are enumerated by the library function getEntityType (Current reference)
I don't think that you can use a general type like "Dimension" and that you need to be more specific.
Comma separated ... Don't add leading or trailing spaces for the types in the list.

Regards,
CVH

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

Re: dwgexplode script

Post by CVH » Fri Aug 29, 2025 8:13 am

For the record:
Duplicate question of forum post p42415 :wink:
The example command string included there by Andrew explodes only Text entities.
OR
It skips exploding all of the listed types.

Regards,
CVH

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

Re: dwgexplode script

Post by WildWolfCJ » Mon Sep 08, 2025 2:14 am

CVH wrote:
Thu Aug 28, 2025 2:27 pm
Hi,

dwgexplode is geared to explode all complex entities.

The limiting switch works as the inverse of what you aim for ...
... Specify what not to explode and exclude the required type from this list.

An example command is given that explodes all except texts and polylines.
Add ",Block Reference,Spline,Solid,Hatch" and so on.

It only concerns all visible drawing entities in the model.
Textual entity types in the switch are enumerated by the library function getEntityType (Current reference)
I don't think that you can use a general type like "Dimension" and that you need to be more specific.
Comma separated ... Don't add leading or trailing spaces for the types in the list.

Regards,
CVH
Thank you for your reply. In my project, I need to be able to specify a certain element to explode, while other elements remain unchanged.

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

Re: dwgexplode script

Post by CVH » Mon Sep 08, 2025 3:58 am

WildWolfCJ wrote:
Mon Sep 08, 2025 2:14 am
Thank you for your reply. In my project, I need to be able to specify a certain element to explode, while other elements remain unchanged.
Then use a default list that excludes all supported types and remove those from the list that must be exploded.
Thinking of a regular expression what should be supported in common program languages.

For layers and blocks the reference of other command line tools state that a regular expression is supported.
Not for the list of types used in dwgexplode.

Perhaps a nice enhancement that the use of a regular expression for entity types would be supported.
One could enter a Feature Request on QCAD Bugtracker.

Or you might ask for a Command Line tool that only explodes the listed types.
'As is' it is rather dwgnotexplode :lol:

Regards,
CVH

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”