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!

Find Duplicate Parts in an Assembly 2

Status
Not open for further replies.

db85

Mechanical
Mar 5, 2009
4
I'm looking for a way to find duplicate parts in an assembly, meaning parts that are overlapping by almost 100% such as a screw directly on top of another screw. Interference detection is an option but finds too much, I would like to write a macro but don't know where to start. Any suggestions would be much appreciated!
 
Replies continue below

Recommended for you

Hi, db85:

What do you mean by "too much"? Interference detection is exactly what you need.

Good Luck!

Alex
 
Interference detection will find all the areas where screws are properly installed in threaded holes as well as nuts. He wants to find totally overlapping geometry.

Can't give any direction however. Is definitely a unique problem.

-Dustin
Professional Engineer
Certified SolidWorks Professional
Certified COSMOSWorks Designer Specialist
Certified SolidWorks Advanced Sheet Metal Specialist
 
This might be a real round-about solution... and I don't really know how/if it can be implemented.

If the parts have similar filenames (I am assuming they do because you identified them as duplicate parts)... You could traverse the assembly tree identifying the situations where multiple instances of the same part exist. Then you should (maybe) be able to identify where the center of mass is for the part in question. You could then compare the distance between the mass centers of each similar part. If the mass centers are close together, they probably overlap.

I don't have the foggiest how to implement this... but that functionality in a macro should result in a means to identify duplicate (overlapping) identical files.

-Dustin
Professional Engineer
Certified SolidWorks Professional
Certified COSMOSWorks Designer Specialist
Certified SolidWorks Advanced Sheet Metal Specialist
 
db85,
Try this. In the search bar of your assembly type in your part number. SW narrows down the parts in your assy. Then select the parts one by one. If the same part visually highlights for different selections, then there's probably a duplicate on top of each other. I hope this makes sense.

see attached

Colin Fitzpatrick (aka Macduff)
Mechanical Designer
Solidworks 2009 SP 4.1
Dell 490 XP Pro SP 2
Xeon CPU 3.00 GHz 3.00 GB of RAM
nVida Quadro FX 3450 512 MB
3D Connexion-SpaceExplorer
 
 http://files.engineering.com/getfile.aspx?folder=15cafe24-cfd7-4ddf-b06a-2a6beadeb8c6&file=Dup_Parts.jpg
Shaggy's solution sounds the most elegant. A distance interrogation between origins could also be employed in said macro ... and perhaps the offending parts could be highlighted/selected in the FM and/or graphics area.
 
Hi, db85:

If you use SW2010, you suppress all parts except toolbox items and do an inteference detection. This should help you spot your overlapped components.

Good Luck!

Alex
 
Thanks for all the responses,
I like the idea of comparing origins and/or centers of mass between parts of the same name, I will try that approach and let everyone know how it works out. As far as isolating screws before performing interference detection, that is true I could do that but in some cases I am actually also looking for duplicate parts overlapping that are not screws. A case where this would happen would be if a part at a higher assembly was moved to a lower assembly and for whatever reason not removed from the higher one.
Thanks everyone
 
This may be a bit late, but give the following a try.
[ol]
[li]Open the assembly.[/li]
[li]Use mass properties to find its volume (assembly volume). I ran a simple test and it looks like this volume is the sum of the component volumes, and does not take overlap into account.[/li]
[li]Save the assembly as a part, with the all components option selected. This generates a part with a solid body for each of the components.[/li]
[li]Create a solid block large enough that the assembly would be able to fit inside it.[/li]
[li]Use mass properties to find its volume (block volume).[/li]
[li]In the block, use insert part to include the part version of the assembly. Position it so that it falls entirely within the block.[/li]
[li]Insert a combine feature and select subtract. Use the block as the main body and all of the bodies of the inserted part as Bodies to Subtract. Keep all of the bodies.[/li]
[li]Use mass properties to find the new volume (new volume). [/li]
[/ol]
block volume – new volume + assembly volume = total volume of overlap

To narrow it down further, you could write a macro which subtracts the solid bodies one at a time and compares the decrease in the block’s volume with the volume of the subtracted solid body.

If you have access to the mold design tools you might be able use the cavity tool to accomplish the same thing without saving the assembly as a part.

Eric
 
I wrote a simple macro that steps through the assembly components and checks if a)their name is the same and b)their orgin is at the same location in the assembly. Works great! Thanks everyone
 
Wanna share the macro? It sounds like a fun one to tinker with.

-Dustin
Professional Engineer
Certified SolidWorks Professional
Certified COSMOSWorks Designer Specialist
Certified SolidWorks Advanced Sheet Metal Specialist
 
A star to you alex,

Simple but effective way, In my experience most of the trouble of this sort occurs only with toolbox parts/smart parts.
 
Something else that is an invaluable tool is the Isolate command. You can window over a region to select parts and/or select them from the tree then RMB and select Isolate. It hides everything that wasn't selected. Simply looking at which parts are visible in the tree then makes it easy to find dupes. This could be used in conjunction with the other methods described above.

- - -Updraft
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor