Page 1 of 1

Get a count of component occurrences in an assembly?

Posted: Thu Dec 23, 2021 1:31 pm
by mike miller
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

Re: Get a count of component occurrences in an assembly?

Posted: Thu Dec 23, 2021 3:40 pm
by DLZ_SWX_User
Thanks @mike miller ,

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

Re: Get a count of component occurrences in an assembly?

Posted: Thu Dec 23, 2021 4:25 pm
by artem
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):

And here is the macro to write the qty to the custom property so you can then use it for naming:

Re: Get a count of component occurrences in an assembly?

Posted: Fri Dec 24, 2021 8:14 am
by gupta9665
You can also look at the codes posted here https://forum.solidworks.com/thread/50568

Re: Get a count of component occurrences in an assembly?

Posted: Fri Dec 24, 2021 9:23 am
by mike miller
artem wrote: Thu Dec 23, 2021 4:25 pm 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):

And here is the macro to write the qty to the custom property so you can then use it for naming:
Thanks @artem. 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.

Re: Get a count of component occurrences in an assembly?

Posted: Wed Jan 04, 2023 3:08 pm
by starshiphalo2333
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

Re: Get a count of component occurrences in an assembly?

Posted: Wed Jan 04, 2023 6:05 pm
by josh
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.

Re: Get a count of component occurrences in an assembly?

Posted: Wed Jan 04, 2023 6:36 pm
by starshiphalo2333
josh wrote: Wed Jan 04, 2023 6:05 pm 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.

Re: Get a count of component occurrences in an assembly?

Posted: Thu Jan 05, 2023 10:03 am
by bnemec
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".

Re: Get a count of component occurrences in an assembly?

Posted: Thu Jan 05, 2023 5:17 pm
by josh
starshiphalo2333 wrote: Wed Jan 04, 2023 6:36 pm 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.
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.

Re: Get a count of component occurrences in an assembly?

Posted: Fri Jan 06, 2023 7:53 am
by mattpeneguy
josh wrote: Thu Jan 05, 2023 5:17 pm 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.