New Script Add-on, Purge Tool

This forum is for 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: Clive, andrew, Husky

New Script Add-on, Purge Tool

Postby 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 4719 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 4719 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 4719 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
Clive
Moderator
 
Posts: 930
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: New Script Add-on, Purge Tool

Postby 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
J-J
Moderator
 
Posts: 175
Joined: Tue Mar 24, 2009 9:48 pm

Re: New Script Add-on, Purge Tool

Postby 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
Husky
Moderator
 
Posts: 674
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: New Script Add-on, Purge Tool

Postby 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
andrew
Site Admin
 
Posts: 2619
Joined: Fri Mar 30, 2007 6:07 am

Re: New Script Add-on, Purge Tool

Postby 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!
User avatar
Husky
Moderator
 
Posts: 674
Joined: Wed May 11, 2011 9:25 am
Location: USA


Return to QCAD 3 ' script Add-On & Plug-in challenge '

Who is online

Users browsing this forum: No registered users and 0 guests