Hi @Robert.Egel7SPMT. Zach was on the right track, but the one keyword ("ComponentDefinition") in the path was a little off for working with a component (should have been just "Definition"). Here is an example of some iLogic code in an assembly. It has examples of getting the origin point and X axis of the first component in the assembly. But those can not be used directly in constraints that are created at the main assembly level directly. You must use a proxy of those objects for things like constraints and measurements. Take a look at this code.
If ThisDoc.Document.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then
MsgBox("An Assembly Document must be active for this rule to work. Exiting.", vbCritical, "")
Exit Sub
End If
Dim oADoc As AssemblyDocument = ThisDoc.Document
Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
Dim oOccs As ComponentOccurrences = oADef.Occurrences
Dim oConsts As AssemblyConstraints = oADef.Constraints
Dim oOcc1 As ComponentOccurrence = oOccs.Item(1)
Dim oOcc1OriginPoint As WorkPoint = oOcc1.Definition.WorkPoints.Item(1)
Dim oOcc1XAsis As WorkAxis = oOcc1.Definition.WorkAxes.Item(1)
'those are in the context of that other model document's 3D space, not main assembly
'to get them in assembly, use this method, and you will get their 'proxy' version
Dim oOcc1OriginPointProxy As WorkPointProxy = Nothing
oOcc1.CreateGeometryProxy(oOcc1OriginPoint, oOcc1OriginPointProxy)
Dim oOcc1XAxisProxy As WorkAxisProxy = Nothing
oOcc1.CreateGeometryProxy(oOcc1XAsis, oOcc1XAxisProxy)
'now you can use these proxy object for your measurements and constraints in the main assembly
Edit: To help explain a bit more...the first WorkPoint object in every model document (parts & assemblies) will be the one shown within its Origin folder, so it will be its Origin Point. The first 3 WorkPlanes found in every model type document will be its 3 origin planes, in the same order as you see them, with the X-Axis being the first one. The first 3 WorkAxis objects found in every model type document will be its origin axis objects, in the order you see them. Those natural objects are defined within the 3D coordinate system of that document only though, so when you put the model into an assembly, as a component, all the geometry from that model that you see in the assembly is 'proxy' geometry, meaning it is like a translated copy of the original geometry, and the original objects are not actually there. Those proxy versions are now within the 3D coordinate space of the assembly, where it can not be measured to/from or constrained to something else in the assembly. The only geometry really native to an assembly are its origin work features, any new work features that you create directly within the main assembly, and any sketches you create directly within the main assembly. Pretty much everything else is a proxy.
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield

(Not an Autodesk Employee)