×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

NXopen.UF.UFmodl.CreateSimplifiedCurve

NXopen.UF.UFmodl.CreateSimplifiedCurve

NXopen.UF.UFmodl.CreateSimplifiedCurve

(OP)
How to use this function,
Please help.
I am using VB.net to program.

RE: NXopen.UF.UFmodl.CreateSimplifiedCurve

Below is a journal to create simplified curves. A couple of thing to note. You did not indicate your version of NX. This journal works for NX8 and NX8.5 If your version is pre NX8 you need to change

Dim resp As Selection.Response = _
ui.SelectionManager.SelectTaggedObject("Select a spline", _
"Select a spine", _
Selection.SelectionScope.AnyInAssembly, _
Selection.SelectionAction.ClearAndEnableSpecific, _
False, False, mask, sp1, cursor)

to

Dim resp As Selection.Response = _
ui.SelectionManager.SelectObject("Select a spline", _
"Select a spine", _
Selection.SelectionScope.AnyInAssembly, _
Selection.SelectionAction.ClearAndEnableSpecific, _
False, False, mask, sp1, cursor)

The second thing to note is that NX documentation suggest using

ufs.Curve.CreateSimplifiedCurve(curve_count, curves, tolerance, segment_count, segments)

instead of

ufs.Modl.CreateSimplifiedCurve(curve_count, curves, tolerance, segment_count, segments)

because the modl version will be removed in the future.

I have written the code for selecting a single spline. If your case is different please supply more information.

CODE -->

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpenUI

Module Module1
    Dim s As Session = Session.GetSession()
    Dim ui As UI = UI.GetUI()
    Dim ufs As UFSession = UFSession.GetUFSession()
    Sub Main()
        Dim response1 As Selection.Response = Selection.Response.Cancel
        Dim spline1 As Spline = Nothing
start1:
        response1 = Select_a_Spline(spline1)
        If response1 = Selection.Response.Cancel Or response1 = Selection.Response.Back Then GoTo end1
        Dim curve_count As Integer = 1
        Dim curves() As Tag = {spline1.Tag}
        Dim tolerance As Double = 0.01
        Dim segment_count As Integer = Nothing
        Dim segments(-1) As Tag
        ufs.Modl.CreateSimplifiedCurve(curve_count, curves, tolerance, segment_count, segments)
        GoTo start1
end1:

    End Sub
    Function Select_a_Spline(ByRef sp1 As Spline) As Selection.Response
        Dim mask(0) As Selection.MaskTriple
        mask(0).Type = UFConstants.UF_spline_type
        mask(0).Subtype = 0
        mask(0).SolidBodySubtype = 0
        Dim cursor As Point3d = Nothing
        Dim resp As Selection.Response = _
        ui.SelectionManager.SelectTaggedObject("Select a spline", _
        "Select a spine", _
        Selection.SelectionScope.AnyInAssembly, _
        Selection.SelectionAction.ClearAndEnableSpecific, _
        False, False, mask, sp1, cursor)
        If resp = Selection.Response.ObjectSelected Or _
        resp = Selection.Response.ObjectSelectedByName Then
            Return Selection.Response.Ok
        Else
            Return Selection.Response.Cancel
        End If
    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 Module 

Regards

Frank Swinkels

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources