Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Get XYZ point coordinates from PointTag

Experimenter
Experimenter

Having used the

UFSession.Point.CreateOnSurface

method (in C#), returns the tag of the created point feature as the output. This variable is simply called "NewPointTag" in my case.

 

What I would like to do is print the XYZ coordinates of the newly created point to the listing window.

 

For example,

NewPointFeature.GetEntities()[0]

 seems to return the point object, but ".Coordinates" does not work.

 

How can I access the coordinates?

 

Cheers!

3 REPLIES

Re: Get XYZ point coordinates from PointTag

Honored Contributor
Honored Contributor

Here's one method:

You can use the .GetTaggedObject method to get the point object from the tag. Once you have the point object, you can access its .Coordinates property to get the XYZ values.

Re: Get XYZ point coordinates from PointTag

Siemens Phenom Siemens Phenom
Siemens Phenom

As is often the case in NX, there is more than one way to acoomplish this. Cowski has pointed out one.  Another method if you have the tag is to call the wrapper method for UF_CURVE_ask_point_data().  It takes the tag as the input, and provides an array of three doubles for the output relative to the Absolute coordinate system.

Re: Get XYZ point coordinates from PointTag

Experimenter
Experimenter
Thank you both, I've used the latter approach now and it works nicely!

For C#:

theUFSession.Curve.AskPointData(NewPointTag, point_coords)