Get a geometry information of object

Hello.

I use Python, but I think it doesn't matter.

I need to get a geometry information of the Face as well as I get it through the user interface (Menu -> Information -> Object or Ctrl+I).

Actually I need just the following parameter:


Normal - Absolute I = -0.420212290
J = -0.907389507
K = -0.008118760

I tried to record journal file:


selectedObjects1 = [NXOpen.NXObject.Null] * 1
selectedObjects1[0] = face
self.theSession.Information.DisplayObjectsDetails(selectedObjects1)

But this code displays a ListingWindow. Of course I can parse it, but I think there is a better way.

How can I get this geometry parameter?

You can get some face information from the .AskFaceData function. If the face is planar, this will also give you the normal direction. If the face is not planar, the normal direction will change depending on where you measure it. Using the .AskFaceProps function, you can get the normal direction for a given U V parameter. Given a point in 3D space, you can get the U V parameter on the face with .AskFaceParm.

Some useful functions to get surface information:
AskFaceData
AskFaceProps
AskFaceUVMinMax
AskFaceParm

Thank you! But I don't understand how to use it?

I found some information in official documentation here


Signature: AskFaceData(face)
Parameters: face (Tag) – Face obj_id

Ok. I wrote:


import NXOpen.UF
...
k = NXOpen.UF.Modeling.AskFaceData(face.Tag) # face is an instance of NXOpen.Face

And I catch an error:


descriptor 'AskFaceData' requires a 'NXOpen.UF.Modeling' object but received a 'int'

Have a nice day)

I got it! I need to get session first:


theUfSession = NXOpen.UF.UFSession.GetUFSession()
jj = theUfSession.Modeling.AskFaceData(face.Tag)
<\code>

Have a nice day)