I have been trying to create an assembly wokplane offset from the ZX Plane but it is not working. I think my problem is my inability to add a new plane based on the ZX plane prior to offsetting it?
Any help would be welcome.
Try
Dim oWorkPlane As Inventor.WorkPlane = oOcc.Definition.WorkPlanes.Item("ZX Plane")
' Create a proxy for the 1st work plane
Dim oWPObj AsObject = Nothing
' Create a proxy for the 2nd face
Try
Call oOcc.CreateGeometryProxy(oWorkPlane, oWPObj)
Catch ex As Exception
MsgBox(
"The plane selected is wrong " & ex.Message)
EndTry
Dim oOccWPProxy1 As Inventor.WorkPlaneProxy = TryCast(oWPObj, WorkPlaneProxy)
If oOccWPProxy1 IsNothingThen
MsgBox(
"WP Proxy 1 is undefined ")
ReturnFalse
EndIf
oAsmDef.Constraints.AddFlushConstraint(oAsmDef.WorkPlanes(2), oOccWPProxy1, iOffset)
Catch ex As Exception
MsgBox(
"The Plane constraint could not be created: " & ex.Message)
EndTry