NXopen.UF.UFmodl.CreateSimplifiedCurve
NXopen.UF.UFmodl.CreateSimplifiedCurve
(OP)
How to use this function,
Please help.
I am using VB.net to program.
Please help.
I am using VB.net to program.
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS Come Join Us!Are you an
Engineering professional? Join Eng-Tips Forums!
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail. Posting GuidelinesJobs |
NXopen.UF.UFmodl.CreateSimplifiedCurve
|
RE: NXopen.UF.UFmodl.CreateSimplifiedCurve
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 ModuleRegards
Frank Swinkels