Determining What is Pierced by a Vector

I have an interesting challenge that has me stumped. I need to pierce an assembly with a selected vector and extract information about the solids that are pierced. At the most basic level I need the X,Y,Z point where the vector enters and exits each solid and either the name of the part and/or the material of that solid. The assembly can have numerous parts and the vector can be in any direction. Getting the material is cream. If I can get the part names of the pierced parts, I can do a lookup table to get the material. Anyone tried anything like this?

Drew

I don't have any code on hand to do that, but here's what I'd try:

  1. create a line along the vector of interest that passes through the entire assembly
  2. loop through the components, check minimum distance from component to line. If the minimum distance reports as zero, the vector hits these components.
  3. find the min distance along the line from the start/end points of the line to the component to find the points of intersection (min point is returned in one of the measurement functions).
  4. report name, material, and points of intersection of component pierced by the line.

Thanks. I like the minimum distance method you described. I was hoping to find a way to use the intersection command but this sounds simpler. I'll give that a try.

Drew

Drew

There is an Open C function called UF_MODL_trace_a_ray() that does exactly that.

It is wrapped for use in NXOpen.Net as UFModl.TraceARay()