Cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect behavior for assembly File.

I have a "assembly file".In this assembly file there is a point on face of assembly file.

In my apllication, I used following function to know whether that point is on face ,inside face or outside face?

//======================

double[] pointCoordinates = { samplePoint.Coordinates.X, samplePoint.Coordinates.Y, samplePoint.Coordinates.Z };
int pointStatus = 0;
UFSession.GetUFSession().Modl.AskPointContainment(pointCoordinates, faces[jFace].Tag, out pointStatus);

//======================================

above function gives pointStatus = 2 whichmeans point  is outside face.

But visually, this point is on face.What could be the reason behind this behaviour?

 

for same file and point i used following code.

//=============================================

double[] pointCoordinates = { samplePoint.Coordinates.X, samplePoint.Coordinates.Y, samplePoint.Coordinates.Z };

IntPtr facePointer;
m_nxUFSession.Evalsf.Initialize2( faces[jFace].Tag, out facePointer);

UFEvalsf.Pos3 pos;
m_nxUFSession.Evalsf.AskMinimumFaceDist(facePointer, pointCoordinates , out pos);

//====================================================

from above function,ideally pos.distance should be zero as that point on face.

pos.pnt should be same as that point.

But in this case it gives some distance and point other than reference  point.

Please let us know your views on that issue?

Is something is missing from side?

Thanks in advance.

 

2 REPLIES

Re: Incorrect behavior for assembly File.

Honored Contributor
Honored Contributor

Since you are working in an assembly, you need to be aware of the difference between prototype and occurrence objects. I suspect that you are referencing the prototype face when you need the occurrence face.

 

Check out chapter 11 in the SNAP guide for an overview of prototypes vs. occurrences.

Re: Incorrect behavior for assembly File.

Thanks a lot!
It solved my problem.