Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Object Count of Layer

Status
Not open for further replies.

kr7530

Automotive
Joined
Aug 9, 2011
Messages
130
Location
US
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
 
Are you talking about 'Components' of an Assmebly? And if so, I assume that you're looking at the Layer list for the Assembly file, correct?

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
John,

Yes, X2 is a temporary assembly and yes, the layer list for the assembly. Once all needed geometry is created in X2, X10 will be deleted from X2 because it will no longer be needed for reference.
 
One thing to keep in mind, when adding Components to an Assembly, there's a 'Layer Option' in the 'Settings' section of the 'Add Component' dialog. Make sure you've selected the 'Option' that gives you what you expect.

John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
Siemens PLM:
UG/NX Museum:

To an Engineer, the glass is twice as big as it needs to be.
 
Thanks John, we have looked into this and found that changing the "Layer Option" has undesired effects. I am currently trying to change the selection scope of the program to ignore sub-components.

Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top