6 Replies Latest reply on Feb 5, 2013 12:56 AM by Prasanna Kalidass

    Check Ballooning is done for each BOM item

    Prasanna Kalidass

      Hi,

       

      Is there any api/macro to check whether the Item in BOM is Ballooned or not??

       

      BOM.bmp

       

      Above shows, Row 2 and 3 are ballooned where as Row 4 and 5 are not ballooned. Is there a way to find it using api/macro.

       

      Please help.

        • Re: Check Ballooning is done for each BOM item
          Glenn Schroeder

          Hello,

           

          Since the little balloon icons with the 1 in them already indicate which components are ballooned I don't understand why you need a macro, but if you still want one you might get more responses if you move this discussion to the API section.

          • Re: Check Ballooning is done for each BOM item
            Keith Rice

            Prasanna,

             

            I am not aware of such a macro. I believe you would need to traverse all balloons in a particular view and use IAnnotation::GetAttachedEntities3 in order to find out what components they are attached to. I actually have a free video tutorial  that walks through a very similar macro. It demonstrates how to write a macro that deletes balloons attached to fasteners. I think you would find it very helpful, should you pursue writing this macro.

             

            Keith

            Video Tutorials for the SolidWorks API

              • Re: Check Ballooning is done for each BOM item
                Prasanna Kalidass

                Thanks Keith. Hope there is no method in BomAnnotation, BomTable, BomFeature or TableAnnotation.

                • Re: Check Ballooning is done for each BOM item
                  Prasanna Kalidass

                  Dim BOMTable1 As BomTableAnnotation
                          swDrwDoc.ActivateView(View.GetName2)
                          bRet = swModel.Extension.SelectByID2(ViewName, "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing, 0)
                          BOMTable1 = View.InsertBomTable2(False, 0.0, 0.0, swBOMConfigurationAnchorType_e.swBOMConfigurationAnchor_TopLeft, swBomType_e.swBomType_PartsOnly, Config, "")

                          Dim SelecMgr As SelectionMgr
                          SelecMgr = swModel.SelectionManager
                          bRet = swModel.Extension.SelectByID2(ViewName, "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing, 0)

                          Dim View5 As View
                          Dim Ann5 As Object
                          View5 = SelecMgr.GetSelectedObject5(1)
                          Ann5 = View5.GetAnnotations
                          Dim bret5 As Boolean
                          For i1 = 1 To nNumRow1 - 1
                              BOMTable1.GetComponentsCount2(i1, Config, ItemNumber1, PartNumber1)
                              Try
                                  Dim swAnn As Annotation
                                  Dim swNote As Note
                                  Dim Dis As String = Nothing
                                  For I As Integer = 0 To UBound(Ann5)
                                      Dis = Nothing
                                      bret5 = False
                                      swAnn = Ann5(I)
                                      If swAnn.GetType = swAnnotationType_e.swNote Then
                                          swAnn.Select3(False, Nothing)
                                          swNote = SelecMgr.GetSelectedObject5(1)
                                          If swNote.IsBomBalloon Then
                                              Dis = swNote.GetText
                                              If Dis IsNot Nothing Then
                                                  If Dis = ItemNumber1 Then
                                                      ''Balloon is available
                                                      bret5 = True
                                                      Exit For
                                                  End If
                                              End If
                                          End If
                                      End If
                                     
                                  Next I
                                  If bret5 = True Then

                                  Else
                                      Table1.Text(i1, 5) = "Part Not Ballooned"
                                  End If
                              Catch ex As Exception
                              Finally
                                
                              End Try
                          Next i1

                   

                   

                  Thanks Keith.. I have compared the Baloon Text with BOM Item No to sort it out.

                   

                  the Code might not be in Order. Thanks