AnsweredAssumed Answered

How do I check the name of a feature with code?

Question asked by Alexander Kibbe on Jan 28, 2016
Latest reply on Jan 28, 2016 by Alexander Kibbe

I'm trying to write a macro that creates an offset surface then thickens it (ultimately the amount it offsets and thickens will be user input-able but for now i just want it to work)

 

This code is the only version that has functioned this far.  The obvious problem is that I obviously can't count on knowing the Name of the offset surface in advance.  Is there any way to get the name of the surface that the "Part.InsertOffsetSurface(0.01, False)" command produces? So that I can use it in the selectbyID command?  Or is there any other way to get this to function?

 

Sub main()

 

    Set swApp = Application.SldWorks

 

    Set Part = swApp.ActiveDoc

    boolstatus = Part.InsertOffsetSurface(0.01, False)

    Part.ClearSelection2 True

    boolstatus = Part.Extension.SelectByID2("Surface-Offset38", "REFSURFACE", 0, 0, 0, False, 1, Nothing, 0)

    Dim myFeature2 As Object

    Set myFeature2 = Part.FeatureManager.FeatureBossThicken(0.01, 1, 0, False, False, True, True)

 

 

End Sub

Outcomes