I used "ProjectCurve" to project a point onto a face. I am trying to get the coordinates of the projected point.
I recorded an NXOpen journal with c++, that utilizes NXOpen::Features:rojectCurveBuilder to create a projection. When trying to access the point, here goes:
NXOpen::Features:rojectCurve *projectCurve1(dynamic_cast<NXOpen::Features:rojectCurve *>(workPart->Features()->FindObject("CPROJ(2)")));
NXOpen:oint *point1(dynamic_cast<NXOpen:oint *>(projectCurve1->FindObject("POINT 1")));
However I want to make the program flexible so that the program won't look for "CPROJ" or "POINT 1", but to get the projected point from the projectcurvebuilder that I just created. (Meaning no using FindObject)
How should I do that? How do I tell NXOpen to get features that are of ProjectCurve type?
Solved! Go to Solution.
When you call the "Commit" method of your ProjectCurveBuilder, it will return a ProjectCurve feature, which is what you should use instead of the one obtained from FindObject.
The "Getting Started with SNAP" document has a section that discusses the FindObject problem (in chapter 16). It might help you to read this.
In NX/Open documents, replacing FindObject calls is sometimes known as the "jounrnal stickiness" problem. If you search the docs for this term, you might also find some useful info.
From the ProjectCurveBuilder you can get the entities created which using vb is
Dim projectCurveBuilder1 As Features.ProjectCurveBuilder
Dim nXObject1 As NXObject
nXObject1 = projectCurveBuilder1.Commit()
Dim projpnt() As NXObject
projpnt = projectCurveBuilder1.GetFeature.GetEntities
It could be that you have point(s) and curve(s) in "projpnt" you then have to check whic is the point of interest. If you have only created one point then it is projpnt(0).