×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

will or how to delete files automatically after pack & go

will or how to delete files automatically after pack & go

will or how to delete files automatically after pack & go

(OP)
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

RE: will or how to delete files automatically after pack & go

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.

RE: will or how to delete files automatically after pack & go

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
http://intercad.com.au/
Tel: +61 2 9454 4444

RE: will or how to delete files automatically after pack & go

You can also select the zip function within pack and go. Unzip to a new folder, delete the old files. But as the others wrote, manually delete.

Chris
SolidWorks 11
ctopher's home
SolidWorks Legion

RE: will or how to delete files automatically after pack & go

(OP)
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

RE: will or how to delete files automatically after pack & go

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
http://intercad.com.au/
Tel: +61 2 9454 4444

RE: will or how to delete files automatically after pack & go

(OP)
hello again & thank you so much - there is a runtime error in the macro

RE: will or how to delete files automatically after pack & go

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
http://intercad.com.au/
Tel: +61 2 9454 4444

RE: will or how to delete files automatically after pack & go

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
http://intercad.com.au/
Tel: +61 2 9454 4444

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources