Batch purging of drawing files using ScriptPro 2.0

By Virupaksha Aithal

This post will explain the procedure to use ScriptPro 2.0 tool to purge a set of AutoCAD drawing files.

Step1:
Download the ScriptPro 2.0 tool from http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=4091678&linkID=9240618

Step2:
Create an AutoCAD Script file which does the purging. You can use the ScriptPro key words to save the drawing with a new name after the purge. Below script file appends the “_Purged” to the drawing name. For example, drawing name “wheel.dwg” will be saved as “wheel_purged.dwg” after running the script. Save the script file.

[Start]
;command
-purge
;Enter type of unused objects to purge
All
;Enter name(s) to purge <*>:

;Verify each name to be purged? [Yes/No]
No
SAVEAS
;Enter file format

;Save drawing as
"<acet:cFolderName>\<acet:cBaseName>_purged.dwg"

[End]

Step3:
Start the ScriptPro tool.
Use the “wizard” options to start the ScriptPro wizard.

Wizard

Step4:
Browse and selected the Script file saved in Step2 as the Script file to use. Refer “a”
Add the drawing files which need to be purged using “Add” button in wizard. Refer “b”
Select the AutoCAD version to be used for the batch operation. Refer “c”
Press “Finish and Start ScriptPro” button to start the batch purging. Refer “d”.

Wizard1


Comments

27 responses to “Batch purging of drawing files using ScriptPro 2.0”

  1. Virupaksha,
    I have had ScriptPro2.0 since It was released.
    It looks like this build is different ….
    it uses a different menu and form design and can use accoreconsole.exe and ACAD2013.
    Why is it still called version 2.0 when it is obviously different.
    Regards
    Kerry

  2. And I just noticed that you are the Author.
    Thanks !
    Regards
    Kerry

  3. Hi Kerry
    Thanks for comments.
    Yes, ScriptPro 2.0 has changed a lot from the original version released in November 2010. But the core logic is still the same as the original version. The new version contains few bug fixes and new features like wizard. but the same time we have changed the assembly versions 2.0.3.0.
    regards
    Viru

  4. Thanks Viru.
    Perhaps one way to let people know the current version would be to add the assembly version to the site. Otherwise people will either miss the update or download each month just to see if it is new :)
    … Or post a notice here will suit those of us who visit here.
    Regards
    Kerry.

  5. Virupaksha aithal Avatar
    Virupaksha aithal

    Good idea.
    I post the update in this blog when I update the ScriptPro next time…
    regards
    Viru

  6. Patricia Avatar
    Patricia

    Just what I have been looking for! I’ve tried it and it works – fantastic.
    Thank you so much.

  7. I tried ScriptPro 2.0 with accoreconsole.exe. I can run my raw script with accoreconsole and it runs fine to completion. But if I try to harness it with ScriptPro… The log files say: “Error while reading log file for… ”
    What would you suggest I try?

  8. Hi,
    Tough to say what is going wrong. can you please share the non confidential script file you are using at your end.
    Thanks
    Viru

  9. On “Error while reading log file…” I had the thought this evening that this may stem form having log file location in a location other then out of the box default. Default log file location for ScriptPro does not automatically change to where the autocad profile points to. Tomorrow I’ll try setting both to the same location. Question: Does ScriptPro automatically do LOGFILEON?

  10. Another question: Am I seeing that you cannot use vl-, vla- and vlax- functions with accoreconsole?
    Also, LAYOUTLISP I believe is a core lisp function. The console doesn’t recognize it?

  11. Thomas Avatar
    Thomas

    I like this little piece of magic :)
    I ran into a problem though: I was making a “purge” script for a batch of drawing, but I wasn’t able to disable the prompt “Thich block contains dynamic Features. Would you like to open it in the block editor?” when opening a drawing. Thus, resulting in failing my script to run.
    Is there any option to disable that prompt?

  12. Walker Macy Avatar
    Walker Macy

    this would be great if it worked…it hangs when trying to open Autocad 2014, on Windows 7 x64. tried on two different machines. “unable to open autocad” or just hangs and never opens autocad

  13. Jesse (aka) CadDog Avatar
    Jesse (aka) CadDog

    Well, Looks Great but I haven’t been able to get it to work.
    I used your purge scr as it first and it failed. I change the scr a little by – to _ just in case but with no luck.
    I’m using AutoCAD Civil 3D 2011 on Windows 7×64.
    I hope this very cool looking app works soon.
    Thanks

  14. How can you configure ScriptPro to open password protected files?

  15. Jose Luis Avatar
    Jose Luis

    Download link don´t open.

  16. hi,
    I try this link http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=4091678&linkID=9240618
    but there is no scriptpro 2 for download, is anyone know where to download the ScriptPro 2?
    many thanks

  17. Hi,
    Yes, we are trying to fix this issue. Till that please get the installer from Gethub @ https://github.com/ADN-DevTech/ScriptPro-installer
    Thanks
    Viru

  18. Hi Virupaksha,
    could you please provide some information how to create scp project file, eventually how to save current project into scp.
    se also http://forums.augi.com/showthread.php?147750-ScriptPro
    thanks
    kuba

  19. I’m getting the following error: “Error while reading log file for… ” and it doesn’t work. any ideas?

  20. James Maeding Avatar
    James Maeding

    BTW, do not use scripts to clean excess reg apps (application IDs). It is a waste of time as the xrefs load when the file opens and your purges either lock or take 20-30 seconds if you really have an app id problem. So many people put -purge R in their startup, but they have yet to experience current drawing and 2 xrefs with 50k+ app ids. That stops everything. Not that app ids are corruption, but they bulk the file and prevent Audit from running (well, finishing) if you need to. Instead use the Autodesk regapp cleaner or my batcher posted in .net forums, or JTB purger – anything but a tool like full acad or coreconsole.

  21. Dutchtower Avatar
    Dutchtower

    Hi,
    I have a simple script to audit and save a drawing that works when I drag it into the AutoCAD Drawing Area, but if I run it in ScriptPro2, it leaves the .dwl and .dwl2 files for the selected drawing in place and shows “Failed in the ScriptPro window.
    I am new to scripts so forgive any naiveté.
    Here is the script:
    audit
    y
    QSAVE
    Thanks in advance

  22. I am trying to Purge (including nested data, orphanage data etc. ) in Autocad 2016. What should be the script. I have written the following :
    ;command
    -purge
    ;Enter type of unused objects to purge
    All
    ;Enter name(s) to purge <*>:
    ;Verify each name to be purged? [Yes/No]
    No
    ;command
    qsave
    ;command
    CLOSE
    it is not working. Shows failed in scriptpro window.

  23. Dutchtower,
    I’m having the same issue. Did you get a solution?
    Thanks

  24. Had an error in my script
    Contained an extra “space” at the last line of the script, which acts as an “enter”, so it was restarting the previous command, then sitting there waiting to be told what to do next, then timing out.
    So lesson is….make sure last line in script is the same as the last input you would enter at the command line in autocad

  25. Michael Behar Avatar
    Michael Behar

    Can ScriptPro load .NET Assemblies?

  26. Hi,
    Yes, load the AutoCAD.NET assemlies through script file. like

    >
    FILEDIA
    0NETLOAD
    “D:\Temp\mytest.dll”
    FILEDIA
    1
    >

  27. alana Avatar
    alana

    i’ve tried this and i have checked my script works on one file which it does.
    then fails when i try to run it using these steps on 3 files.
    autoCAD 2020.

Leave a Reply to ViruCancel reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading