New Script Add-on, Purge Tool

This forum is for 'Work-in-Progress' QCAD user developed script Add Ons and Plug-ins.

Please use this forum to request/submit your script Add-Ons & Plug-in idea's.

Moderators: andrew, Husky, J-J

Post Reply
User avatar
Clive
Moderator
Posts: 1329
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

New Script Add-on, Purge Tool

Post by Clive » Wed Mar 06, 2013 11:23 pm

Hi Guys
I would like to bring your attention to a new Script 'Add-on' tool which Andrew has created. This new tool belongs to the Modification tool-set in QCAD.

http://www.ribbonsoft.com/en/qcad-add-ons

This new Purge tool purges all unused layers and block definitions in a drawing. Added to menu Modify - Purge.

To add the tool quite simply download the zip file and copy and paste the 'Purge' folder (which contains the script files, i.e. Purge zip > Scripts > Modify > Purge folder ) into the QCAD > Scripts > Modify folder.
*Note - you may need to apply permissions to run the script!
In windows
1. Navigate to the QCAD installation files, C. Drive > Program files > QCAD folder.
2. 'Right - click' the QCAD folder and choose the Properties option.
3. Select Security tab.
4. Select Users (your name PC\Users).
5. Click on Edit, click on Full control -click on Apply and OK.
This should set the permissions to run the script.

An example of where this tool may be useful

Here is an example of a Topography file that I occasionally get to 'clean up' for laser cutting (etching/scoring for architectural site map).
As it is at the moment it contains 183 layers and 454 Block definitions - too much for what I need! :cry:
Using Purge tool example 1.png
Using Purge tool example 1.png (230.98 KiB) Viewed 18592 times
So... after selecting the Block definitions and exploding them, I can now use the new Purge tool from the Modify tool-set (drop down menu) to clean things up.
Using Purge tool example 2.png
Using Purge tool example 2.png (282.51 KiB) Viewed 18592 times
The resultant purge leaves me with only 35 layers and no blocks -brilliant, a much lighter file for me to use. Now I can select everything and move all entities onto just one layer, change the line weight ready for laser cutting.

Job done :wink:
Using Purge tool example 3.png
Using Purge tool example 3.png (222.44 KiB) Viewed 18592 times
Of course this is just my example, this tool will undoubtedly be useful for all types of drawings where you can just select this Purge tool and it will dynamically delete all your unused layers and block definitions any time!

User avatar
J-J
Moderator
Posts: 502
Joined: Tue Mar 24, 2009 9:48 pm

Re: New Script Add-on, Purge Tool

Post by J-J » Thu Mar 07, 2013 10:26 pm

Thanks for the reminder Clive, that's one tool which will be a definite plus!
JJ

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4935
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: New Script Add-on, Purge Tool

Post by Husky » Wed Mar 20, 2013 8:36 am

Thanks guys - that is a nice and powerful tool! Thumps up!

I have one question about it: From time to time we are faster than we should - but we have a "Undo" function.
If I use the Purge tool it cleans nicely all unused Layer and Blocks - but if I use the "Undo" Function only the layer are coming back - the Blocks are gone for ever.
My understanding for a "Undo" is everything has to be "un-done". Why is that so?

User avatar
andrew
Site Admin
Posts: 9037
Joined: Fri Mar 30, 2007 6:07 am

Re: New Script Add-on, Purge Tool

Post by andrew » Wed Mar 20, 2013 9:13 am

Husky: two transactions are necessary to purge layers and blocks. An otherwise unused layer might be used by an unreferenced block. So blocks are purged first, then the transaction is committed and then layers are purged.

To undo, hit undo twice for both transactions.

To avoid this confusion, we might have to split up the tool into two tools.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 4935
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: New Script Add-on, Purge Tool

Post by Husky » Wed Mar 20, 2013 7:12 pm

andrew wrote:To undo, hit undo twice for both transactions. To avoid this confusion, we might have to split up the tool into two tools.
Yep - twice works - thanks!
Two tools - sounds good to me. That means even more flexibility to clean up a drawing. Nice!

Post Reply

Return to “QCAD 'Script Add-On & Plug-in challenge' - Work in Progress”