AnsweredAssumed Answered

Macro Feature / API question Knitting Bodies

Question asked by Drew Miller on May 4, 2017
Latest reply on May 5, 2017 by Peter Brinkhuis

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?