4 Replies Latest reply on Aug 24, 2017 2:53 PM by Aaron Larson

    BOM Rows for only Ballooned Components

    Aaron Larson

      I'm creating a spare parts/service BOM type drawing.  Each sheet has specific components ballooned.  I'd like to have a table on each sheet that shows only the rows of the ballooned components (similar to the same question here).  I know that Composer can probably do this much easier but we don't have it and probably won't get it.  So... with the thought that it won't be the last time I'll have to create/update something like this I am out to make a macro. 


      My question here is to get some feedback on the approaches.  I don't need a complete solution, I'm moderately experienced with the API.  Just looking for feedback from the community; no right or wrong necessarily.



      • Macro is to be used on only the current sheet (no need for recursive)
      • There is a BOM table on the sheet
      • There are ballooned views (maybe not a strict precondition but let's assume there are)


      Method 1:

      • Go through each view on the current sheet and interrogate the annotations.
      • For those that are balloons I can store the item number in a collection
      • Next grab the BOM table and go through each row and hide it if the item number is not in the Item Numbers collection


      Method 2:

      • Get the BOM table first
      • Look at the row and get the component
      • Somehow see if the component has a balloon attached?
      • Or get the row and get the item number, then loop through all balloons to see if the item number is there, if not hide the row


      Honestly I'm leaning toward method 1 but maybe there's a 3rd or 4th that's much easier that I'm not seeing.

        • Re: BOM Rows for only Ballooned Components
          Nilesh Patel

          Hi Aaron,


          Method 1 seems to be easy and straight forward approach. Only trouble I can think of is if someone accidentally creates extra balloon (which shouldn't be there) the the drawing views or forgets to create a balloon (which needs to be there) for a component then your macro will work accordingly and you may end up with wrong BOM.


          Do you use specific naming convention for your parts? How do you decide what components to go in BOM table in each sheet? You can use this information to double check whether required components have been ballooned or not in each drawing sheet. This will eliminate any human error.


          Let us know how you go.

            • Re: BOM Rows for only Ballooned Components
              Aaron Larson

              Hi Nilesh - thanks for the feedback.  The drawings are created very specifically and case by case.  We don't require these often.  Each sheet has 1 drawing view representing a portion of the overall assembly and this sheet has it's own BOM table based on the view from the drawing.  There is no naming convention or custom property that dictates the serviceabilty of the component.  The decision of which components go on which sheet is mostly up to the engineer with input from the product manager.  The checking process to ensure all required items are ballooned and have a line in the BOM is entirely manual.  The macro success would hinge on confidence that the balloons have been placed correctly.

                • Re: BOM Rows for only Ballooned Components
                  Alex Burnett

                  I would tend to agree on Nilesh's suggested approach for method 1. It's possible to get the drawing view object on the sheet and then get the annotations attached to that view. Iterate through the annotations and check for the type (INote i think) to make sure it's a balloon. From there, you can get the associated text in the balloon with GetBomBalloonText. Add the balloon number to an array of Integers perhaps.


                  This shows a little bit in terms of an example.


                  From there, you will need to get an instance of the table annotation and iterate through each row and compare your array of Integers to the column that correlates to the value shown in the bubble. Then you hide the row similar to this.


                  If I had more time, I would certainly try to throw something together but I hope this helps for now.

                    • Re: BOM Rows for only Ballooned Components
                      Aaron Larson

                      Yes Alex - that is precisely the path I was leaning toward.  It just happens that I crashed SW while writing the macro and lost all my work.  In order to get the drawing done I had simply used the show/hide selected rows to interactively hide the rows that did not have the little balloon icon next to them.  That actually went fairly quick and would have worked better if I could have sorted by that "value".  I still like the idea of a macro though.  Once the rules and logic are nailed down they are so much more bulletproof than people.