×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Count how many parts in assembly that are the same part.

Count how many parts in assembly that are the same part.

Count how many parts in assembly that are the same part.

(OP)
Hi,
Sorry for making so many posts, but I have one more spot where I am stuck. I need the qty of each part in the active assembly. Currently I am looping through all the parts so there is probably just some code that i could put in the loop that would count how many parts of each there is. Any body done this before or got any ideas.Thanks.

RE: Count how many parts in assembly that are the same part.

There's no way I know of to directly get the component count through the API.  You will have to somehow count 'em up as you loop through the tree. One way to do this would be to use the Excel list you are making.  I assume you are wanting to put the quantity in there anyway in some other column.  Basically, before adding any part to the Excel list, loop thru the Excel list and see if the part number already exists in the list.  If it does, increment its qty column instead of adding it to the end of the list.

-handleman, CSWP (The new, easy test)

RE: Count how many parts in assembly that are the same part.

(OP)
Hmmm.. Dummy of BOM that is interesting had not thought of that, I'll see if I can pull that off. If not then I might just go with checking to see if it already exists in the excel sheet like handleman suggested. Thanks  

RE: Count how many parts in assembly that are the same part.

bguenther,

Which version of SW are you using?

SW2009 has a built in "BOM from assy model" function.

cheers

RE: Count how many parts in assembly that are the same part.

I have used the dummy drawing with a BOM also. You can keep it and update it, and always go back to it.

Chris
SolidWorks/PDMWorks 08 3.1
AutoCAD 08
ctopher's home (updated Aug 5, 2008)
ctopher's blog
SolidWorks Legion

RE: Count how many parts in assembly that are the same part.

(OP)
CorBlimeyLimey,
I am using SW2008 SP4.0. So you just make a drawing add a BOM and read the QTY column and then I would use that to put in my excel sheet ?  

RE: Count how many parts in assembly that are the same part.

Yes, for SW08 ... or you could use the macro TheTick suggested, to create the BOM directly from the model. No drawing required.

SW09, has that same function built in.

cheers

RE: Count how many parts in assembly that are the same part.

I have used the custom filter at the top of the feature tree in an assembly to see all of the instances in an assembly.  It's more of a quick and dirty way instead of creating a BOM.

RE: Count how many parts in assembly that are the same part.

I'd recomend using the macro TheTick suggested.  It gets the component count (and other properties) and will export it to a spreadsheet.  You should be able to extract some code from it.

Joe
SW Office 2008 SP4.0
P4 3.0Ghz 3GB
ATI FireGL X1

RE: Count how many parts in assembly that are the same part.

(OP)
I guess I am pretty dumb because that macro is very confusing to me, I can't figure out what code is all needed to do that job.

RE: Count how many parts in assembly that are the same part.

The Advanced Select Functionality might be able to do this. You can set filter criteria like Volume = Value or Component name contains "WORD" and then use that to select the components and get a count of the objects selected.

In 2008 you also might try the Assembly Xpert which can count the number of components that are unique parts or configurations.

Michael

RE: Count how many parts in assembly that are the same part.

(OP)
I guess it is sort of , sorry I did not intend on this being a repost.    

RE: Count how many parts in assembly that are the same part.

I certainly didn't mean that it was a repost, because it is a slightly different question and this is really the best place for it.  However, people were giving answers that either had already been given or were not necessarily in the direction you were looking to go, based on information in the other thread.

-handleman, CSWP (The new, easy test)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources