Eng-Tips is the largest forum for Engineering Professionals on the Internet.

Members share and learn making Eng-Tips Forums the best source of engineering information on the Internet!

  • Congratulations JStephen on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

EKL measure distance from Pad 1 to Pad 2

Giddleytwig

Computer
Joined
Jul 31, 2025
Messages
1
Hello

I am trying to measure the distance between 2 pads in a 3DExperience CATIA EKL action using the distance function. But the distance function requires a body for both inputs. To convert the Pads to Body objects I am trying to extract a Surface from the pads and then measure the distance between each Surface. The Below code is what I have so far

Code:
let subElements(List)
//SelectedObject is a Pad selected from the product tree on running the EKL action
subElements = SelectedObject.GetSubElements(2)
let index(Integer)
for index = 1 while index < subElements.Size() {
    let faceElement(CATFace)
    Set faceElement = subElements.GetItem(index)
    let surfaceElement(Surface)
    set surfaceElement = extract(faceElement, 3)
    
    Notify(surfaceElement.PrimaryType.Name)
}

I confirmed that SelectedObject has the pad. I confirmed that the List does contain a CATFace object as well, but when the code gets to the extract function i get the evaluation error

"Evaluation error
One mandatory input element is invalid, empty or missing. : extract"

After that it throws an error for the Notify saying that

"Evaluation error in when calling Notify - Attempt to read the attribut Name on an empty variable"


I know that the faceElement variable is resolving since I have printed it out and it is not NULL, and it is showing as the correct face for the pad I select, but for some reason extract wont take it as input no matter what I put for the second input. Any help with either solving the extract issue or helping with an alternative to the ultimate goal of measuring distance between 2 pads would be great.

Thanks!
 

Part and Inventory Search

Sponsor

Back
Top