You do not need a macro but can use advance component selection tool (and save that for future use). And then you can select all of those components, select component properties and set the BOM options as needed. This would be faster than using a macro.
Thank you for pointing out the advance component selection tool. Good to know about it and will come in handy at some point.
For the issue stated though not so much the reason being that the *start* components only get used once in 99% of the cases so it isn't about finding the part in the feature tree or ASM but about it always being excluded from the BOM.
E.g.: it's always the first component listed
So that's a master or skeleton part. If you've have that across sub assemblies too, then using the same method would work. This means selecting them all and setting them exclude from BOM at same time.
I'm sure that macro can be made, will give it shot sometime. Too much stuff on my plate right now.
Use advanced select and enter file name search criteria (or conditions) with the string you are looking for. Save the search filter for future reuse. Then simply RMC the selection and select "exclude from BOM". Can be done out of the box and just as fast as a macro.
Thank you for the input. But as mentioned in my reply to Deepak, it isn't so much about locating the part but about it being excluded from the BOM.
As it stands it comes down to, once one has navigated to the component :
1. RMC on component
2. move the pointer and click on component properties
3. move the pointer and click on exclude from bill of materials
4. move the pointer and click OK
The majority of ASM's we make are routing ones. And 40% or so begin with a 'start' component which we then have to hide, or better still, exclude from the BOM. After doing that for some years I think I paid my dues and would love to it just being a key-combo or a icon to click.
If it would always be the same one or two components I would just record a macro of setting the particular boolean status. But of just those 'start' components we have ±10 different ones. Not to mention there are other components as well that we don't need to include in our BOM.
The main thing that stops me from doing that :
"boolstatus = Part.Extension.SelectByID2("startflens_RVS-1@iso_03_spool1_SM", "COMPONENT", 0, 0, 0, False, 0, Nothing, 0)"
as you can see it is linked to the name of the ASM, which doesn't help seeing as not 2 ASM's have the same name.
Further more :
"boolstatus = Part.CompConfigProperties5(2, 0, False, True, "Start RVS304 DN 100 Ø114, 3", True, False)"
it only sets it for the particular active config.which is normal because 'exclude from bom' is part of the configuration specific properties
Which means that even if I record a macro it would only work for one particular 'start' component in one particular ASM and for one particular config of the 'start' component.
Not knowing how to write a macro means that I can't make the needed adjustments.
Thank you for pointing out the advance select and have a nice one.
You can set the start component to "envelope". That way it will be excluded from BOM and will not show up in your drawing views or model unless you choose to show it.
The other option is to assign a custom property value to the start file. For instance property "CLASS" and give it a value "REF".
You can traverse the assembly feature tree and read this property and then set it to "Exclude from BOM". Look in this forum. Such a macro already exists. Search for "traverse assembly tree", "recursive search", or the like. I usually start with google that will almost all the time show me the SW forum hits as well.
Try that. If you really can't get ahead then let me know what you found and we go from there.