Get a count of component occurrences in an assembly?
- mike miller
- Posts: 878
- Joined: Fri Mar 12, 2021 3:38 pm
- Location: Michigan
- x 1070
- x 1231
- Contact:
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
We would like to have that value returned for use in a naming string if possible.
@gupta9665
@artem
@josh
@Rob
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:
Go to full postAnd here is the macro to write the qty to the custom property so you can then use it for naming:
He that finds his life will lose it, and he who loses his life for [Christ's] sake will find it. Matt. 10:39
-
- Posts: 48
- Joined: Mon Dec 20, 2021 1:40 pm
- Location: Thumb Area of Michigan, USA
- x 175
- x 26
Re: Get a count of component occurrences in an assembly?
Thanks @mike miller ,
This is what I was trying to get to happen in the thread:
https://www.cadforum.net/viewtopic.php?p=9594#p9594
This is what I was trying to get to happen in the thread:
https://www.cadforum.net/viewtopic.php?p=9594#p9594
Re: Get a count of component occurrences in an assembly?
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:
And here is the macro to write the qty to the custom property so you can then use it for naming:
Thanks,
Artem
xarial.com - making your CAD better
codestack.net - SOLIDWORKS API macros and tutorials
Artem
xarial.com - making your CAD better
codestack.net - SOLIDWORKS API macros and tutorials
Re: Get a count of component occurrences in an assembly?
You can also look at the codes posted here https://forum.solidworks.com/thread/50568
Deepak Gupta
SOLIDWORKS Consultant/Blogger
SOLIDWORKS Consultant/Blogger
- mike miller
- Posts: 878
- Joined: Fri Mar 12, 2021 3:38 pm
- Location: Michigan
- x 1070
- x 1231
- Contact:
Re: Get a count of component occurrences in an assembly?
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.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:
He that finds his life will lose it, and he who loses his life for [Christ's] sake will find it. Matt. 10:39
-
- Posts: 9
- Joined: Fri Sep 30, 2022 11:49 am
- x 1
Re: Get a count of component occurrences in an assembly?
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
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?
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.
-
- Posts: 9
- Joined: Fri Sep 30, 2022 11:49 am
- x 1
Re: Get a count of component occurrences in an assembly?
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?
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?
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.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.
- mattpeneguy
- Posts: 1386
- Joined: Tue Mar 09, 2021 11:14 am
- x 2489
- x 1899
Re: Get a count of component occurrences in an assembly?
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.