Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
JelteDeJong
in reply to: K.clement

Looking at the code I expect this is not an iLogic rule. (But an addin?) Anyway, I guess that your function looks something like this:

Public Sub YourFunction(oOcc As ComponentOccurrence)
	Dim oADef As ComponentDefinition = g_inventorApplication.ActiveDocument.ComponentDefinition
	Dim oAsmXYPlane As WorkPlane = oADef.WorkPlanes.Item(3) 'Assembly XY Plane
	Dim oAsmZAxis As WorkAxis = oADef.WorkAxes.Item(3) 'Assembly Z Axis


	Dim oODef As ComponentDefinition = oOcc.Definition
	Dim oOccXYPlane As WorkPlane = oODef.WorkPlanes.Item(3) 'Occurrence XY Plane
	Dim oOccZAxis As WorkAxis = oODef.WorkAxes.Item(3) 'Occurrence Z Axis
	oOcc.CreateGeometryProxy(oOccXYPlane, oOccXYPlane)
	oOcc.CreateGeometryProxy(oOccZAxis, oOccZAxis)
End Sub

What I understand from the Microsoft link that you send is that your function is not defined correctly. 

Did you try using the keywords ByVal or ByRef? Something like this:

Public Sub YourFunction(ByVal oOcc As ComponentOccurrence)

or

Public Sub YourFunction(ByRef oOcc As ComponentOccurrence)

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com