Move work plane in Feature tree in a part

Move work plane in Feature tree in a part

J.VandeMerckt
Advocate Advocate
200 Views
2 Replies
Message 1 of 3

Move work plane in Feature tree in a part

J.VandeMerckt
Advocate
Advocate

Hi Everyone

Is it possible to move a existing workplane in the feature tree of a Part?
I have a Ilogic which creates a new workplane but I would like to move the workplane to the top of the feature tree.
The workplane is called "YZ Plane (Mid)"
All help is welcome. Thank you!

0 Likes
Accepted solutions (1)
201 Views
2 Replies
Replies (2)
Message 2 of 3

marcin_otręba
Advisor
Advisor
Accepted solution

try this code, but remember if workplane depends from any feature then it can't be moved above it in model browser:

 

Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition
oCompDef = oDoc.ComponentDefinition
Dim oPane As BrowserPane
oPane = oDoc.BrowserPanes.ActivePane
'get workplane
Dim oWp As WorkPlane=oCompDef.WorkPlanes("YZ Plane (Mid)")
Dim movingnode As BrowserNode
'get workplane node
movingnode = oPane.GetBrowserNodeFromObject(oWp)
Dim targetnode As BrowserNode
Dim ft As PartFeature
'get first partfeature node
ft =oCompDef.Features.Item(1)
targetnode = oPane.GetBrowserNodeFromObject(ft)
'move node
Try
oPane.Reorder(targetnode, True, movingnode)
Catch
	MessageBox.Show("Unable to move worplane - check dependencies", "Error")

End Try


Hi, maybe you want to check my apps:


DrawingTools   View&ColoringTools   MRUFolders

Message 3 of 3

J.VandeMerckt
Advocate
Advocate
Works exactly like I need it.
Thanks Marcin
0 Likes