6 Replies Latest reply on Sep 25, 2017 4:11 AM by Elmar Klammer

    exclude from BOM based on the name of the part

    Peter De Vlieger

      Situation :

      We have certain parts that get used rather often. Unfortunately there wasn't really a set manner to name them but all of them have "start" it them.

      E.g.: startflens_PP ,  startflens_RVS , HDPE_start , PVC_start, etc.


      Now I was wondering if someone could possibly write a macro that checked if a part containing "start" was present in either an ASM or a sub-ASM of the open ASM and if so set that part's component properties as 'exclude from BOM'


      If it would be to difficult to check on "start" with wildcard possibilities both prefixing and suffixing it then perhaps one could make it even more open ended by basing the search parameter on a list of exact names of parts in which case it could have a much more general use because then one would solely have to modifying the item(s) in the list as need be.


      Anyone having some spare time and willingness to devise something like that or is there an option I'm overlooking so that one can set 'exclude from bom' in the part itself prior to actually using it in an ASM.

        • Re: exclude from BOM based on the name of the part
          Deepak Gupta

          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.

          • Re: exclude from BOM based on the name of the part
            Elmar Klammer

            Hi Peter,


            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.



              • Re: exclude from BOM based on the name of the part
                Peter De Vlieger



                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.


                  • Re: exclude from BOM based on the name of the part
                    Elmar Klammer

                    Hello Peter,


                    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.