Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Deleting Assemblies 1

Status
Not open for further replies.

Drhinehart

Mechanical
Apr 21, 2004
64
Is there anyway to delete an assembly and all it's components from a directory in one shot?


I have a sub-assembly that I now longer need and I would like to delete it and all referenced parts that belong to that sub-assembly. Can I do this across the board or am I going to have to delete each individual file?


Thanks,

Dale
 
Replies continue below

Recommended for you

I'm not aware of a way to do it across the board, but you could use SolidWorks Explorer to find out which files could safely be deleted.
 
I don't know how to delete an assembly with all of the parts, but one thing you could do is open the assembly, then File > Find References, then print the list so you know what to delete.

Flores
 
This can be done through the API - basically you:

-use ActiveDoc to get the active document (which you want to delete, along with it's references)
-use GetDependencies2 to get the model references
-use GetPathName to find out where those referenced files live
-use VB command "KILL" or FileSystemObject (FSO) method to delete those files

This is a little dangerous since files that are deleted might be used in other places than what you want deleted. I suppose some type of "Where Used" search would be ideal before deleting.
 
I agree it could be a dangerous thing, but these particular files are only referenced by that one sub-assembly they just got dumped into a directory somehow.

I appreciate the response back and will update you how eveything goes with it.


Thanks,

Dale
 
Create a TEMP folder. Use SolidWorks Explorer to copy your main assembly & all related files into that folder. Open the assembly & make sure all the parts & sub-assemblies are coming from your TEMP folder. Then delete everything from the original folder. Now move all the files from yout TEMP folder - back into the original folder & detete the - now empty - TEMP folder. Don't forget your drawings too.

Does it sound like I speak from experience? [wink]

[idea] SolidWorks 2005 SP01.1 / Windows 2000 Professional [idea]
 
Did not think of doing that.. it just sounds too simply. Thanks Tate I will pass the info along.
 
enAlright's ideia seems to be a prety good one.

This is something that SW Explorer should do. Not just a simple and dangerous delete, but an "assisted" one. Example: for each file, a confirmation window together with a list of "where used?". Or at least a move or rename with "find children" that would allow us to segregate the files easely and test the model integrity before deleting them with Windows Explorer.

This and the ability of renaming/copying integral sets from assembly to parts drawing would be two important improvments (maybe for SW2006?).

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor