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


Journal To Move Assembly Constraints To Layer

Journal To Move Assembly Constraints To Layer

Journal To Move Assembly Constraints To Layer

I have a pretty basic question.
I am trying to write a journal to move assembly constraints to specific layer.
I can write the journal works with bodies:

"Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.NXObject
Module Module1
Sub Main()
Dim theSession As Session = Session.GetSession()
If IsNothing(theSession.Parts.BaseWork) Then
End If
Dim workPart As Part = theSession.Parts.Work
' Bodies to layer 1
Const BodiesLayer As Integer = 1
Dim displayModification2 As DisplayModification
displayModification2 = theSession.DisplayManager.NewDisplayModification()
displayModification2.NewLayer = BodiesLayer
End Sub
End Module"

And it works fine. But with constrains it didnt work:
Syntax errors:
Line:"It is not possible to convert a 1-D array from NXOpen.Positioning.Constraint to 1-D array from NXOpen.DisplayableObject, because NXOpen.Positioning.Constraint is not derived from NXOpen.DisplayableObject"
Any help would be greatly appreciated!!!

RE: Journal To Move Assembly Constraints To Layer

I think Constraints , like features cannot be moved to a separate layer.

John Joyce
Manufacturing Engineer

NX 11 & 12.01 Vericut 8.0.3

If I asked people what they wanted, they would have said faster horses

- Henry Ford

RE: Journal To Move Assembly Constraints To Layer

If you choose the "move to layer" function, "assembly constraint" is an option in the filter window. I've used this many times to organize the display, and am also very interested in automating this operation.

NX Windows 10

RE: Journal To Move Assembly Constraints To Layer

There is a DisplayedConstraint object type that is used to represent the constraint in the graphics window. These objects inherit from the DisplayableObject type and can be hidden, moved to a new layer, etc. If you have a reference to a constraint object, use its .GetDisplayedConstraint method to get the corresponding displayed constraint.


RE: Journal To Move Assembly Constraints To Layer

Do you have a good reason why move these ?


RE: Journal To Move Assembly Constraints To Layer

Yes, I need to draw up a lot of models, and I want to automate it. But I still didnt finish a journal...

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!


White Paper – Your Construction ERP RFP Checklist
Selecting business software for a medium to enterprise-sized construction concern is extremely challenging in large part because most enterprise resource planning (ERP) suites originated in the world of repetitive manufacturing and are therefore a poor fit for a project and asset-centric business. However, midsize to large contractors need the predictable, auditable processes that ERP delivers. Download Now

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close