×
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

How to remove TINY OBJECTS in NX UG?

How to remove TINY OBJECTS in NX UG?

How to remove TINY OBJECTS in NX UG?

(OP)
The part I'm working on is a Curve>Extract from bodies... I would like to delete the TINY OBJECTS (defined as dimension .025 inch) appearing on my window.

Please help!

RE: How to remove TINY OBJECTS in NX UG?

(OP)
They are lines, splines, arcs & curves (FymI)

RE: How to remove TINY OBJECTS in NX UG?

before you extract curves from bodies perform a file->export ->heal geometrie
the distance can improve / optimze the extracted curves from body on the healed body

RE: How to remove TINY OBJECTS in NX UG?

Here's a quick journal that will delete curves smaller than a value you specify.

CODE

Option Strict Off
Imports System
Imports System.Collections.Generic
Imports NXOpen

Module Module1

    Sub Main()

        Dim theSession As Session = Session.GetSession()
        Dim workPart As Part = theSession.Parts.Work
        Dim smallCurves As New List(Of Curve)

        '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
        '%% curves less than or equal to the following length will be deleted
        '%% change this value to your requirement
        Const smallCurveCutoff As Double = 0.025
        '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

        For Each tempCurve As Curve In workPart.Curves

            If tempCurve.GetLength <= smallCurveCutoff Then
                smallCurves.Add(tempCurve)
            End If

        Next

        If smallCurves.Count > 0 Then

            Dim markId1 As Session.UndoMarkId
            markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Delete small curves")

            Dim notifyOnDelete1 As Boolean
            notifyOnDelete1 = theSession.Preferences.Modeling.NotifyOnDelete

            theSession.UpdateManager.ClearErrorList()

            Dim nErrs1 As Integer
            nErrs1 = theSession.UpdateManager.AddToDeleteList(smallCurves.ToArray)

            Dim notifyOnDelete2 As Boolean
            notifyOnDelete2 = theSession.Preferences.Modeling.NotifyOnDelete

            Dim nErrs2 As Integer
            nErrs2 = theSession.UpdateManager.DoUpdate(markId1)

        End If


    End Sub


    Public Function GetUnloadOption(ByVal dummy As String) As Integer

        'Unloads the image when the NX session terminates
        GetUnloadOption = NXOpen.Session.LibraryUnloadOption.AtTermination

        '----Other unload options-------
        'Unloads the image immediately after execution within NX
        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately

        'Unloads the image explicitly, via an unload dialog
        'GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Explicitly
        '-------------------------------

    End Function

End Module 

www.nxjournaling.com

RE: How to remove TINY OBJECTS in NX UG?

(OP)
Thanks a lot! It worked!! :)

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