Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Journal to Delete Basic Curves

Status
Not open for further replies.

kr7530

Automotive
Aug 9, 2011
130
0
0
US
I have a journal where the user selects curves to be deleted. My problem is that I have been unable to determine if a selected curve has dependents so that it can be removed from the list of curves to be deleted. Any help would be greatly appreciated.

Thanks,
Kevin
 
Replies continue below

Recommended for you

If you're trying to delete all unused entities in a file there's:

File-->Utilities-->Part Cleanup has a "Delete Unused Objects"

Or is the object to just delete certain unused curves?
 
This is a situation that I've also recently encountered. A function that may help you is highlighted below.

Code:
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module Module1

    Sub Main()

        Dim theSession As Session = Session.GetSession()
        Dim theUfSession As UFSession = UFSession.GetUFSession()
        Dim workPart As Part = theSession.Parts.Work

        Dim featTag As Tag = Tag.Null

        For Each myCurve As Curve In workPart.Curves
            theUfSession.Modl.[highlight #FCAF3E]AskObjectFeat(myCurve.Tag, featTag)[/highlight]
            If featTag = Tag.Null Then
                'curve is unused
                myCurve.Highlight
            End If
        Next

    End Sub


End Module

www.nxjournaling.com
 
Status
Not open for further replies.
Back
Top