You can't directly reposition a typical work plane in Inventor. This is
because they're position is parameterically defined and moving it to any
arbitrary position would be breaking that definition.
There is an exception to this. Through the API you can create something
called a Fixed Work Plane. This is a work plane that is positioned at a
fixed location in space without any parametric relationships. Here's some
sample code that illustrates using one of these. This sample converts an
existing work plane to one of these types. This will cause the previous
parametric definition to be lost. You can also directly create a fixed
workplane using the WorkPlanes.AddFixed method.
Public Sub MoveWorkPlane()
Dim oPartDef As PartComponentDefinition
Set oPartDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oWP As WorkPlane
Set oWP = oPartDef.WorkPlanes.Item("Work Plane2")
Dim oTG As TransientGeometry
Set oTG = ThisApplication.TransientGeometry
' Change the defininition to a fixed type of workplane.
Call oWP.SetFixed(oTG.CreatePoint(0, 0, 0), oTG.CreateUnitVector(1, 0,
0), oTG.CreateUnitVector(0, 1, 0))
' Reposition the work plane. You could also call the SetFixed method
again
' to change the position.
Dim oDef As FixedWorkPlaneDef
Set oDef = oWP.Definition
Call oDef.PutData(oTG.CreatePoint(0, 0, 0), oTG.CreateUnitVector(1, 1,
0), oTG.CreateUnitVector(-1, 1, 0))
End Sub
--
Brian Ekins
Autodesk Inventor API
wrote in message news:5518592@discussion.autodesk.com...
Does anybody knows how I can get the position and orientation of the current
work plane?I want to rotate the current work plane about an axis, which one
is depended on the current position of the work plane. Thanks!