Are Edges Tangent?
Are Edges Tangent?
(OP)
I am using NX 7.5.3.
I have list of edges from a face (which also has a hole). I need to loop through all edges to find connected edges and whether the connected edges are tangent are not?
Can someone suggest a suitable function or method to find connected edges and to check whether two given edges are tangent or not?
Thanks,
Prasanna M
I have list of edges from a face (which also has a hole). I need to loop through all edges to find connected edges and whether the connected edges are tangent are not?
Can someone suggest a suitable function or method to find connected edges and to check whether two given edges are tangent or not?
Thanks,
Prasanna M





RE: Are Edges Tangent?
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: Are Edges Tangent?
Programmatic = ?
Regards,
Tomas
RE: Are Edges Tangent?
Yes, I need the programmatic way.
RE: Are Edges Tangent?
Now it is possible that an adjoining face is only partially tangent and so the journal may or may not find the appropriate faces. Also the journal only does the first set of adjacent faces. It does not go any further.
Hope this help you get started if more needs to be done.
CODE --> VB
Option Strict Off Imports System Imports NXOpen Imports NXOpenUI Imports NXOpen.UF Imports NXOpen.Utilities Module AdjacentTangentFaces Dim s As Session = Session.GetSession() Dim ui As UI = ui.GetUI() Dim ufs As UFSession = UFSession.GetUFSession() Dim wp As Part = s.Parts.Work() Sub Main() Dim response1 As Selection.Response = Selection.Response.Cancel Dim startFace As Face = Nothing Dim faceTangency As Boolean = False response1 = select_a_face("Select a face", startFace) ufs.Disp.SetHighlight(startFace.Tag, 1) Dim startfaceEdges() As Edge = startFace.GetEdges For Each e1 As Edge In startfaceEdges Dim adjfacestags(-1) As Tag ufs.Modl.AskEdgeFaces(e1.Tag, adjfacestags) If adjfacestags(0) <> startFace.Tag Then ' check if adjacent face is tangent faceTangency = askForFaceTangency(startFace, e1, adjfacestags(0)) If faceTangency = True Then ufs.Disp.SetHighlight(adjfacestags(0), 1) End If ElseIf adjfacestags(1) <> startFace.Tag Then faceTangency = askForFaceTangency(startFace, e1, adjfacestags(1)) If faceTangency = True Then ufs.Disp.SetHighlight(adjfacestags(1), 1) End If End If Next End Sub Function select_a_face(ByRef prompt As String, ByRef face1 As Face) As Selection.Response Dim mask(0) As Selection.MaskTriple With mask(0) .Type = UFConstants.UF_solid_type .Subtype = 0 .SolidBodySubtype = UFConstants.UF_UI_SEL_FEATURE_ANY_FACE End With Dim cursor As Point3d = Nothing Dim response1 As Selection.Response = Selection.Response.Cancel select_a_face = Nothing response1 = ui.GetUI.SelectionManager.SelectTaggedObject(prompt, prompt, _ Selection.SelectionScope.AnyInAssembly, _ Selection.SelectionAction.ClearAndEnableSpecific, False, _ False, mask, face1, cursor) If response1 = Selection.Response.ObjectSelected Or _ response1 = Selection.Response.ObjectSelectedByName Then Return Selection.Response.Ok ElseIf response1 = Selection.Response.Back Then Return Selection.Response.Back Else Return Selection.Response.Cancel End If End Function Function askForFaceTangency(ByVal startface As Face, ByVal testedge As Edge, _ ByRef nextFacetag As Tag) As Boolean Dim istrue As Boolean = False Dim parm1(1) As Double Dim pointdbl(2) As Double Dim junk3(2) As Double Dim junk2(1) As Double Dim junk1 As Double = Nothing Dim normal1(2) As Double Dim normal2(2) As Double ufs.Modl.AskCurveProps(testedge.Tag, 0.5, pointdbl, junk3, junk3, junk3, junk1, junk1) ufs.Modl.AskFaceParm(startface.Tag, pointdbl, parm1, pointdbl) ufs.Modl.AskFaceProps(startface.Tag, parm1, pointdbl, junk3, junk3, junk3, junk3, normal1, junk2) ufs.Modl.AskFaceParm(nextFacetag, pointdbl, parm1, pointdbl) ufs.Modl.AskFaceProps(nextFacetag, parm1, pointdbl, junk3, junk3, junk3, junk3, normal2, junk2) Dim tangency As Boolean Dim tol1 As Double = 0.01 ufs.Vec3.IsEqual(normal1, normal2, tol1, tangency) Return tangency End Function Public Function GetUnloadOption(ByVal dummy As String) As Integer 'Unloads the image immediately after execution within NX GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately End Function End ModuleFrank Swinkels
RE: Are Edges Tangent?
The function UF_MODL_ask_edge_smoothness may come in handy here.
www.nxjournaling.com