Retrieve edge information

Dear all,
I need to retrieve geometrical information about edges, in particular I need information about the 3D curve
underlying the edge.
From a face I can access the list of edges and, for each edge I can easily know its type

Dim edges() As NXOpen.Edge = face.GetEdges()
For Each edge As NXOpen.Edge In edges
If edge.SolidEdgeType = NXOpen.Edge.EdgeType.Circular Then
'How to know geometrical info such as radius, plane, etc... ?
End If
Next

where face is an NXOpen.Face.
Now how can I extract information such as radius and plane for the circular edge, but also control points for bSpline edges and so on?

I had the same problem with faces and in this forum I was advised to look at

AskFaceData
AskFaceProps

which indeed was exactly what I needed, however I couldn't find anything similar for edges.

Thanks for your attention and help!

Silvia

Using SNAP functions, it's easy -- you just use the "Geometry" property of the edge.

With NX/Open functions, it's bit more complicated. Here's how you do it for an arc edge (C# code):

System.IntPtr intPtr;
NXOpen.UF.UFEval.Arc evalArc;
NXOpen.UF.UFSession ufs = NXOpen.UF.UFSession.GetUFSession();
ufs.Eval.Initialize2(edge.NXOpenTag, out intPtr);
ufs.Eval.AskArc(intPtr, out evalArc);
double radius = evalArc.radius;

There are similar functions like ufs.Eval.AskLine, ufs.Eval.AskSplineControlPts, and so on.

Thank you very much!
I wouldn't be able to find out such a procedure without your help.

Silvia

With your help I can now extract geometrical information from edges, I would also need
to know some topological data such as the edge orientation.
I think UF_BREP should be the class to use, however the NXOpen wrapper doesn't allow to do
much, I couldn't find a way to call UF_BREP_ask_topology or something like that.
Do you know how to inquire topology from NXOpen?

Thanks again,

Silvia

If you need to call the UF_BREP_ask_topology function (or similar), the only feasible way to do that right now is with C++. That function (and other topology functions) use a complicated C datatype construct that doesn't map directly to the managed .net languages.

If you have access to the GTAC forums, this thread gives a bit more information:
https://bbs.industrysoftware.automation.siemens.com/vbulletin/showthread...

> I wouldn't be able to find out such a procedure without your help.

I'm curious to know why not. I did a search of the NXOpen .NET API reference manual, and the UF_EVAL functions were #21 on the returned list of topics. Did searching not work for you?

Let's face it, the API reference is large and even when you have a good idea what it is you are searching for, the information can be hard to find. To really dig out the info takes a time commitment that the user may not be willing to make. If the result is #21 in the list, that's like saying it is on page 21 of a Google search - many will give up if they have to search the search results.

I wrote an article a while back that outlines my "search strategy" for the API reference documents. Results are not guaranteed, but it helps to have a strategy. The article can be found here:
http://nxjournaling.com/?q=content/how-i-stopped-worrying-and-learned-lo...

Thanks for the article. I am quite new to NXOPEN -python.The article was to the point.

Whenever you call (unmanaged) C/C++ code from (managed) .NET code, the function arguments have to be "marshalled" to get them back and forth across the bridge. For simple data types like ints and doubles, this is easy, but for complex structures it's a black art. If you have enough time and determination, you may be able to figure out how to do it, but it won't be easy. I'm not very good at it myself, so I can't help.

Another approach is to create a "shim" DLL that contains some simple C++ functions that call the UF_BREP functions. These functions should return simple data types that will be easy to marshal across to your .NET code.