Hi,
How can I get a part plane's normal in the context of an assembly using the API or ETO?
Here's what I've been trying so far...Does Proxies existe in ETO?
Method getPlaneNormal (prt As Part, workPlaneName As String) As Vector
Dim ivApp As Any = %%inventorapplication
Dim oDoc As Any = ivApp.ActiveDocument
Dim oCompDef As Any = oDoc.ComponentDefinition
Dim partName As String = prt.DisplayName
Dim oPart As Any = oCompDef.Occurrences.get_itemByName(partName)
Dim oPartCompDef As Any = oPart.Definition
Dim oWorkPlanes As Any = oPartCompDef.WorkPlanes
Dim oWorlPlane As Any = oWorkPlanes.get_item(workPlaneName)
Dim oPlaneNormal As Any = oWorlPlane.Plane.Normal
'Create proxy object
Dim oWPpx As Any 'WorkPlaneProxy
oPart.CreateGeometryProxy(oWP, oWPpx)
Return oPlaneNormal
End Method
Regards,
Hi Ludesroc,
We return proxies (where appropriate) for the Intent-controlled entities, including work features, via a call GetHostObject( part)
Your code exposes the problem we are not dealing with yet. We are not supporting .Net calls to the methods with byref notation. For illustation only, the C# compiler demands "out" or "ref" keyword like in following example:
Object wpO;
occ.CreateGeometryProxy(wp, out wpP);
One of the workarounds would be to create .Net library to wrap the similar operations.