Find Duplicate Parts in an Assembly
Find Duplicate Parts in an Assembly
(OP)
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!






RE: Find Duplicate Parts in an Assembly
What do you mean by "too much"? Interference detection is exactly what you need.
Good Luck!
Alex
RE: Find Duplicate Parts in an Assembly
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
RE: Find Duplicate Parts in an Assembly
Chris
SolidWorks 09 SP4.1
ctopher's home
SolidWorks Legion
RE: Find Duplicate Parts in an Assembly
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
RE: Find Duplicate Parts in an Assembly
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
RE: Find Duplicate Parts in an Assembly
RE: Find Duplicate Parts in an Assembly
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
RE: Find Duplicate Parts in an Assembly
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
RE: Find Duplicate Parts in an Assembly
- Open the assembly.
- 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.
- 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.
- Create a solid block large enough that the assembly would be able to fit inside it.
- Use mass properties to find its volume (block volume).
- In the block, use insert part to include the part version of the assembly. Position it so that it falls entirely within the block.
- 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.
- Use mass properties to find the new volume (new volume).
block volume – new volume + assembly volume = total volume of overlapTo 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
RE: Find Duplicate Parts in an Assembly
RE: Find Duplicate Parts in an Assembly
-Dustin
Professional Engineer
Certified SolidWorks Professional
Certified COSMOSWorks Designer Specialist
Certified SolidWorks Advanced Sheet Metal Specialist
RE: Find Duplicate Parts in an Assembly
Simple but effective way, In my experience most of the trouble of this sort occurs only with toolbox parts/smart parts.
RE: Find Duplicate Parts in an Assembly
- - -Updraft