Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Journal to remove phantom objects in layers

Status
Not open for further replies.

Sri089

Aerospace
Sep 18, 2014
10
When doing modelling few layers contain more object counts than the existing entities in that layer.
For example Layer 255 has object count 7. I tried part cleanup to remove unused expressions and checked the layer by blanking and unblanking (ctrl+shift+B) (ctrl+shift+U) then also no objects could be seen in layer 255.
I tried switching off the timestamp and checked the layers in part navigator,I could not find any entities in layer 255.
Can anyone tell how to remove these phantom objects in layers.
Also I want to create a journel to automate this process in different parts.
Can anyone guide me.?

Thanks in advance
 
Replies continue below

Recommended for you

@cowski
I have followed your previous posts and have tried all.
I haved tried deleting unused objects.
No result. object count remains same
 
It is helpful to know what type of objects you are dealing with. The code below will report all the objects that are currently on layer 255.

Code:
Option Strict Off
Imports System
Imports NXOpen

Module Module1

    Sub Main()

        Dim theSession As Session = Session.GetSession()
        If IsNothing(theSession.Parts.Work) Then
            'active part required
            Return
        End If

        Dim workPart As Part = theSession.Parts.Work
        Dim lw As ListingWindow = theSession.ListingWindow
        lw.Open()

        Const undoMarkName As String = "layer inspect"
        Dim markId1 As Session.UndoMarkId
        markId1 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, undoMarkName)

        Const layerNum As Integer = 255

        Try
            For Each temp As NXObject In workPart.Layers.GetAllObjectsOnLayer(layerNum)
                lw.WriteLine("tag: " & temp.Tag.ToString)
                lw.WriteLine("type: " & temp.GetType.ToString)
                lw.WriteLine("")
            Next

        Catch ex As NXException
            theSession.UndoToMark(markId1, undoMarkName)
            MsgBox(ex.Message)

        Finally

        End Try

        lw.Close()

    End Sub

End Module

www.nxjournaling.com
 
Before you start deleting things you don't know anything about :
If you press Ctrl+L you will open the Layer settings dialog. Scroll down this dialog, expand the "Layer control" section and you will find a "Information" button.
press this and you will get information on what kind of objects you have on layer 255. NX will display something like "1 Point 2 Arc 2 Component 2 Assembly constraint etc etc". It might still be objects that you want to keep, Assembly constraints is one example.

Have you imported any data such as DXF/DWG into this model ? It is very common that these files contain View dependent Objects.
A View dependent object is an object which is ONLY visible in a single View. In NX an Invisible object CANNOT be deleted .( unless you run a program to do this.) A typical example of a view dependent object is a text note or a dimension.
If you have Imported DXF/DWG data, the import normally also creates one or more new views, in which these objects are visible . RMB in the graphics, Replace View - Custom Views...( NOT Orient View!) The dialog will contain the imported views, make sure the "Fit" option is ON, then try each of the views in the list.

Another case is if there is a drawing in the Part, any notes, dimensions, symbols etc on this are also view dependent but on the drawing.
- A drawing will be visible in the part navigator.

Regards,
Tomas

 
@cowski,
It was very helpful. I was able to identify the objects in the layer 255.
It shows Nxopen.line,Nxopen.annotations,NXOpen.DisplayableObject

I want to delete annotations and dispalyable objects ,but I have no clue.



@Toost,
I checked the info on layer ,It has
5 Line 2 Drafting Entity

But how to delete these?
Anyhow I have not created or imported DWG files into the part.

Thanks much

 
Switch to the drafting application to see if there are any drawing sheets. If any drawing sheets exist, check to see if there are dimensions or line objects on the sheet.

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

Part and Inventory Search

Sponsor