This content has been marked as final. Show 3 replies
I'll guess that it's using a high enough programming level that it don't need no stinking planes.
First of all, thanks for the question.
The reason I say this is because I have quite a few Library and Palette features and all of them were created with at least one plane, the one the sketch is created on.
Long story short, I don't know how SolidWorks does this. So sorry!
...however, after investigating a bit, I created a hole wizard feature, modified the sketch (quite drastically) and then created a library feature out of it.
So if this is possible, you may be able to get where you need to go following this path.
I'm out of time for today.
Let us know how you do.
I'm thinking the Hole Wizard is basically like a built-in macro feature. The plane that the revolve sketch is built on does exist as a feature in the part. However, you can't access its definition at all. By using the macro below you can actually create a sketch on the same plane used by the revolve. If you then edit the sketch plane of that sketch, SW acts as if the plane is missing.
Also, you can even delete the hole wizard feature after creating a sketch on the revolve's plane. The plane doesn't get deleted, but you can no longer change its location.
Dim swApp As SldWorks.SldWorks
Dim swDoc As SldWorks.ModelDoc2
Dim swSelMgr As SldWorks.SelectionMgr
Dim swSketch As SldWorks.Sketch
Dim swFeat As SldWorks.Feature
Dim DatumType As Long
Dim swSkPlane As Object
Dim swPlane As SldWorks.RefPlane
Dim PlaneData As SldWorks.RefPlaneFeatureData
Set swApp = Application.SldWorks
Set swDoc = swApp.ActiveDoc
Set swSelMgr = swDoc.SelectionManager
If swSelMgr.GetSelectedObjectType3(1, -1) = swSelSKETCHES Then
Set swFeat = swSelMgr.GetSelectedObject6(1, -1)
Set swSketch = swFeat.GetSpecificFeature2
Set swSkPlane = swSketch.GetReferenceEntity(DatumType)
Debug.Print DatumType = swSelFACES, "Face"
Debug.Print DatumType = swSelDATUMPLANES, "Datum"
If DatumType = swSelDATUMPLANES Then
Set swPlane = swSkPlane
'swPlane.Name = "Plane2See"
Debug.Print swPlane.Name & " is hidden?: " & swPlane.GetUIState(swIsHiddenInFeatureMgr)
Debug.Print "Show plane: " & swPlane.Name
swPlane.SetUIState swIsHiddenInFeatureMgr, False