I would like to write a macro that creates a new plane with a given distance dynamically, and then starts a 2D sketch on it. Therefore I need to select the newly created plane before I start the sketch. I couldn't understand how to choose a newly created plane.
My current code looks like this:
Dim myRefPlane As Object
Distance = Distance / 1000
Set myRefPlane = Part.FeatureManager.InsertRefPlane(8, Distance, 0, 0, 0, 0)
boolstatus = Part.Extension.SelectByID2("Plane1", "PLANE", 0, 0, 0, False, 0, Nothing, 0)
The code above just assumes that the new plane is called Plane1, however, this might not be the case. Any ideas?