find all drawings that relate to parts/assy in a top assembly


I have a problem I can't find a solution for. I am designing (not writing) a simple application that will translates all files in an assembly into pdf (if drawings) and STEP (if part or assembly document). All this, by using Solidworks (not PDM Workgroup or anything else).

Say that I have an assembly on 3 levels, 100 parts total, and 50 drawings. I need to create a dialog bix with a table that include all these files, showing what drawing relates to what part/assy. Pretty much like what you get when invoking Pack and Go.

How do I know which drawings relate to what part/assembly so I can save all of them as pdf programmatically?

Thank you for your help


Reply to
Loading thread data ...

If you look in API help you will find by searching the word "traverse" several examples of how to traverse the feature tree in an assembly. When you retrieve each feature in the assembly you can check what it is and output accordingly.

Finding all the drawings is a little different because a drawing is not referenced by its parents. I think SW now has an API that will do this for you without even having SW open. I can't think of what it is called off the top of my head. Documnent Manager comes to mind.

SW Explorer also will find drawings related to assemblies.

If you wanted to find drawings by brute force you could use the filesystem object to find slddrw files and then do some checks on them.

If you use this method you can open SW in the background and not have the files displayed because you are just checking them. That saves a lot of overhead.

T> Hello,

Reply to
Paul B. Kellner

You may want to use the SolidWorks Document Manager (SWDM) object for this. You will need to contact SW to get a key.

Where-used via SWDM can be very slow, as it actually searches through files in all specified locations.

Reply to

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.