×
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

Controling Layers / bodys

Controling Layers / bodys

Controling Layers / bodys

(OP)
Hello i wonder if anyone could help me or point some directions...

i have this code:

CODE

For Each bodyItem As Body In CType(child.Prototype, Part).Bodies
                    Dim tmpNXObject As NXObject = child.FindOccurrence(bodyItem)
                    If Not tmpNXObject Is Nothing Then
                        componentTagList.Add(CType(tmpNXObject, Body).Tag)
                    End If
                Next 
credits: petulf

and i would like to exclude the bodys on layers 50,90,250-255

could anyone point me something ? itryed to record a jounral hiding the layers then adding it to the code but no result :(

NX8.5 - NX9 - NX 10 - NX11

RE: Controling Layers / bodys

Once you have a reference to the body, you can check the .Layer property and take action based on the layer number.

www.nxjournaling.com

RE: Controling Layers / bodys

Use the layer property of the body object and check if the value is in a list of layers.

CODE --> VB

Dim exclusionLayers As New System.Collections.Generic.List(Of Integer)({50, 90, 250, 251, 252, 253, 254, 255})

For Each bodyItem As Body In CType(child.Prototype, Part).Bodies
  Dim tmpNXObject As NXObject = child.FindOccurrence(bodyItem)

  If Not tmpNXObject Is Nothing Then

    If Not exclusionLayers.Contains(bodyItem.Layer) Then
      componentTagList.Add(CType(tmpNXObject, Body).Tag)    
    End If

  End If
Next 

RE: Controling Layers / bodys

(OP)
Thanks both :D

i think it worked i will do some more tests if i ecounter problems i will reach u :)

NX8.5 - NX9 - NX 10 - NX11

RE: Controling Layers / bodys

(OP)
yes its woking :D thank you

in some prts its not doing what its suposed to but i think its because he dont find the linked body prt example:

i have
TOP_PRT
-PRT1 (CONTENTS: SOLID BODY + LINKED garbadge_subprt SOLID BODY)
--garbadge_subprt(CONTENTS: SOLID BODY )
-PRT2 (CONTENTS: SOLID BODY + LINKED garbadge_subprt SOLID BODY)
--garbadge_subprt(CONTENTS: SOLID BODY )


when the code runs if im missing the garbadge_subprt its returning NXopen error. i will explore it and say something :)

NX8.5 - NX9 - NX 10 - NX11

RE: Controling Layers / bodys

(OP)
petulf i had to comment a line from ur export code

CODE

tagsList.AddRange(GetBodyTagsInAsm(currentPart.ComponentAssembly.RootComponent)) 
it was in conflit with what im trying to do.

anyone knows if its possible or could point me something to export a parasolid with another WCS from another file?

example:
TOP_PRT
-PRT1 (CONTENTS: SOLID BODY + LINKED garbadge_subprt SOLID BODY)
--garbadge_subprt(CONTENTS: SOLID BODY )
-PRT2 (CONTENTS: SOLID BODY + LINKED garbadge_subprt SOLID BODY)
--garbadge_subprt(CONTENTS: SOLID BODY )

when i export it will export PRT1/prt2/garbage (separately) with WCS from TOP_PRT

NX8.5 - NX9 - NX 10 - NX11

RE: Controling Layers / bodys

(OP)
cowski since you are more experienced could you point me something on that matter ?

NX8.5 - NX9 - NX 10 - NX11

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