I am confused, could someone please help? I have a component(X2) that contains surfaces on different layers. That component contains another component(X10) that was used for reference only. When I go to my "Layer Setting" the "Object Count" for layer 7 is including items from X10 where as layer 6 does not. Layer count should be 1 for both layer 6 and 7 but it is showing 6 at 1 and 7 at 2. This is with X10 closed. I thought there where objects in X2 that I just couldn't find or display so I used the program below to clear layer 7 but it deleted X10 from tree.
Can anybody explain this for me?
Thanks,
Kevin
NX8.0
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpenUI
Module delete_all_on_layer
Sub Main()
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim layerObjects() As NXObject
Dim UserInputNumber As Double
UserInputNumber = NXInputBox.GetInputNumber("Enter Layer You Wish To Clear", "Layer", 0)
'clearing layer "X" of all entities-------------------------------------------------------------
layerObjects = workPart.Layers.GetAllObjectsOnLayer(UserInputNumber)
If layerObjects.Length > 0 Then
Dim count As Integer = theSession.UpdateManager.AddToDeleteList(layerObjects)
Dim undoMark As Session.UndoMarkId = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Undo Mark")
theSession.UpdateManager.DoUpdate(undoMark)
End If
End Sub
End Module
Can anybody explain this for me?
Thanks,
Kevin
NX8.0
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpenUI
Module delete_all_on_layer
Sub Main()
Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim layerObjects() As NXObject
Dim UserInputNumber As Double
UserInputNumber = NXInputBox.GetInputNumber("Enter Layer You Wish To Clear", "Layer", 0)
'clearing layer "X" of all entities-------------------------------------------------------------
layerObjects = workPart.Layers.GetAllObjectsOnLayer(UserInputNumber)
If layerObjects.Length > 0 Then
Dim count As Integer = theSession.UpdateManager.AddToDeleteList(layerObjects)
Dim undoMark As Session.UndoMarkId = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Undo Mark")
theSession.UpdateManager.DoUpdate(undoMark)
End If
End Sub
End Module