I need help figuring out how to select an offset surface in VBA. I have a macro that makes an offset surface and then is supposed to thicken it but it fails that part because I cannot figure out how to select the surface. Here is the code that matters:
Part.InsertOffsetSurface 0, False
boolstatus = Part.Extension.SelectByID2("", "REFSURFACE", 0, 0, 0, False, 1, Nothing, 0) <-- this is too general
Dim myFeature As SldWorks.Feature
Set myFeature = Part.FeatureManager.FeatureBossThicken(0.02, 0, 0, False, True, True, True)
Additionally, I cannot select it by name because I need to run this multiple times in the same part document. What I want is to select the most recently created offset surface...i.e. make surface, select it, thicken it. Currently, I have a macro that makes the surface and then one that thickens it but I would like to consolidate them. Thanks in advance for anyone's help!
SolidworksApi/macros