1 Reply Latest reply on May 5, 2017 4:14 AM by Peter Brinkhuis

    Macro Feature / API question Knitting Bodies

    Drew Miller

      Hello, I have a standalone macro that knits the surface bodies in a part.


      vBodies = swModel.GetBodies2(swBodyType_e.swSheetBody, True)

      swModel.ClearSelection2 (True)

      For Each itm In vBodies

          Set swBody = itm

          sBodySelStr = swBody.GetSelectionId

          Debug.Print "  " & sBodySelStr

          Select Case swBody.GetType

              Case swSolidBody

                  sBodyTypeSelStr = "SOLIDBODY"

              Case swSheetBody

                  sBodyTypeSelStr = "SURFACEBODY"

          End Select

          boolstatus = swModelDocExt.SelectByID2(sBodySelStr, sBodyTypeSelStr, 0#, 0#, 0#, True, 1, Nothing, swSelectOptionDefault): Debug.Print "     Selected: " & boolstatus

      Next itm

      Set swFeature = swFeatureMgr.InsertSewRefSurface(True, True, True, 0.0000254, 0.0001)


      I would like to know if it is possible to embed this in a Macro Feature, that is at the end of the feature history.  Ideally, the part (which is made up of a varying number of surfaces) would rebuild and knit itself together in the final feature.  Is this possible with a macro feature?