Get a count of component occurrences in an assembly?

Is there any way to get a total count of a component, including inside subassemblies? Like an atomic BOM would do. (don’t say that sentence out loud..)

We would like to have that value returned for use in a naming string if possible.

gupta9665
artem
josh
Rob

Thanks mike miller ,

This is what I was trying to get to happen in the thread: :arrow_right:
https://www.cadforum.net/viewtopic.php?p=9594#p9594

BOM+ (https://cadplus.xarial.com/bom/) has an option to generate flat BOM. Here is the video demonstration (2:10 mark about the flat BOM): https://www.youtube.com/watch?v=rkUi_81mb0I&t=130s



And here is the macro to write the qty to the custom property so you can then use it for naming: https://www.youtube.com/watch?v=Vbxob8fU3R8

You can also look at the codes posted here https://forum.solidworks.com/thread/50568

[quote=artem post_id=16235 time=1640294705 user_id=181]
BOM+ (https://cadplus.xarial.com/bom/) has an option to generate flat BOM. Here is the video demonstration (2:10 mark about the flat BOM): https://www.youtube.com/watch?v=rkUi_81mb0I&t=130s



And here is the macro to write the qty to the custom property so you can then use it for naming: https://www.youtube.com/watch?v=Vbxob8fU3R8
[/quote]

Thanks [mention]artem[/mention]. I was hoping I could get a count as easily as I can get a custom property. Oh well, this works fine even if it’s an extra step.

Does anyone know a way to do this without BOM+ ? BOM+ is a paid add-in, the BOM tools require the 500 AUD license.

I basically one a flat BOM with total quantities of each component (SLDASM and SLDPRT)

BOM Example:
1234B - QTY 1
-----1235C - QTY 5
----------45332 - QTY 2
----------32233 - QTY 1
----------12112 - QTY 5

Desired BOM:
1234B - QTY 1
1235C - QTY 5
45332 - QTY 10
32233 - QTY 5
12112 - QTY 25

Place a single “dummy” empty part in each assembly/subassembly. Give it the custom properties that you want to show in the BOM for that assembly/subassembly. Make a “Parts Only” BOM instead of indented.

Ah, that would work - nice workaround. Unfortunately that’s not a great solution for us, we have thousands of assemblies from over the years (been using SW since 2000). We would have to manually add this dummy part to all of those assemblies - and any new assembly going forward.

Sounds like $500 is a good deal for a turn-key solution that does what you need. I’ve tried to help where I work automate things (mostly because I’m terrible at repeating a mundane process identically over and over). Wrote a BOM extractor for Solid Edge files, then updated it to pull file refs from PDM. What you’re asking for is completely doable. Now I don’t have time for automation/API projects anymore as they have me doing other stuff. They’ve tried hiring contract API labor and are flabbergasted at the hourly rate then looked elsewhere and got similar numbers. I kinda told them, “Yeah, that’s the going rate”.

What format do you need? Are you just looking for a report/knowledge, or are you wanting an actual SolidWorks BOM on a drawing? The “Assembly Visualization” tool will generate the flat total info you’re looking for.

I forgot about that tool because I used it so long ago. It also lets you export to Excel. I remember using it to spit out components and weights because our structural people were trying to determine a center of gravity.