Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

will or how to delete files automatically after pack & go

Status
Not open for further replies.

duk748

Mechanical
Jul 18, 2007
167
hello - will or how is solidworks able to automatically delete files thta have just been packed & go - is there a way to do this or is manually deleting the only waqy - any help would be greatly appreciated - thank you
 
Replies continue below

Recommended for you

Unfortunately, manual deletion is the only available option.

Having said that, maybe an API guru could develop a macro to compare folders and select the 'duplicates' for deletion.
 
There is no event in SolidWorks which notifies me that pack-n-go is completed. However it is possible to create a macro which either calls the Pack-n-Go API thus know when the process is finished or completely reimplement the Pack-n-Go functionality (in this case it can even work without opening the files in SolidWorks).

If I correctly understand your workflow is the following:

1) Open assembly
2) Create pack and go
3) Close assembly
4) Remove assembly files which were just packed in.

Please confirm. If that's correct please clarify what features of Pack-N-Go you are using (prefixes, zipping)? I can help with macro.

Regards,
Artem Taturevych
Application Engineer at Intercad
Tel: +61 2 9454 4444
 
hello again & thank you for the help - yes artemtat's post is what i was looking for - many thanks again to a great group of people & all their help
 
Please check the attached macro which moves and renames thу file and its dependencies.

1) Open the macro in edit mode (Tools->Macro->Edit)
2) You will see the following declaration under the macro header.

Const SOURCE_FILE As String = "C:\Input\Assem1.SLDASM"
Const DEST_FOLDER As String = "C:\Output\"
Const SUFFIX As String = "_test"

3) Specify the input file as first constant, output folder (may be the same as input folder) as second constant (you should include '\' at the end of path, and suffix to append to all file names. Save and run the macro.

Note no SolidWorks documents should be opened when macro running.

This should be executed very quickly because the references updated internally in file without opening in SolidWorks. When done message box is displayed.

Let me know if you have any questions or need some changes.

Hope it helps.

PLEASE BACKUP YOUR DATA WHEN TESTING THE MACRO!

Regards,
Artem Taturevych
Application Engineer at Intercad
Tel: +61 2 9454 4444
 
hello again & thank you so much - there is a runtime error in the macro
 
Hello,

Could you please attach the snapshot of an error and the line of macro it is thrown in?

Regards,
Artem Taturevych
Application Engineer at Intercad
Tel: +61 2 9454 4444
 
Hi,

I'm sorry for that. It seems your assembly has no components. The error you are referring happens when the file has no external reference. Please try the attached macro.

Just for test can you try to run the macro on a simple assembly with one or two components (not virtual components)?


Regards,
Artem Taturevych
Application Engineer at Intercad
Tel: +61 2 9454 4444
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor