Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
felix.cortes5K3Y2
1432 Views, 5 Replies

iLogic Measure Inside Assembly

Hi Forum!

 

I am trying to measure from a component occurrence inside a sub assembly to the XZ work plane on the main assembly. The component occurrence gets selected by the user and has a work surface called "Face0". My goal is to measure from "Face0" of the selected occurrence to "XZ Plane". 

 

Here's the code I've written:

 

	Dim oAsm As AssemblyDocument = ThisApplication.ActiveDocument
	Dim oAsmComp As AssemblyComponentDefinition = oAsm.ComponentDefinition
	Dim Splice As ComponentOccurrence
	Splice = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Select a splice plate")
	
	Dim Height As Double
	'Height = Measure.MinimumDistance(Splice, "Face0", "", "GROUND PLANE")
	Height = Measure.MinimumDistance(Splice, "Face0", oAsm, "GROUND PLANE")

 

This code currently gets an error not sure why. I was wondering if someone has worked on a code similar to this before.

 

The occurrence part is inside "Assembly1" and I am running the code from "Assembly2" as shown in the snippet below

iLogic Snip.png

 

Thanks, 

Felix