×
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

Journal To Move Assembly Constraints To Layer

Journal To Move Assembly Constraints To Layer

Journal To Move Assembly Constraints To Layer

(OP)
Hello!
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
Return
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
displayModification2.Apply(workPart.Bodies.ToArray)
displayModification2.Dispose()
End Sub
End Module"

And it works fine. But with constrains it didnt work:
displayModification2.Apply(workPart.ComponentAssembly.Positioner.Constraints.ToArray)
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 12.0.1.7 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.

www.nxjournaling.com

RE: Journal To Move Assembly Constraints To Layer

Do you have a good reason why move these ?

Regards,
Tomas

RE: Journal To Move Assembly Constraints To Layer

(OP)
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! Already a Member? Login


Resources

eBook - 10 Reasons to Choose CATIA on the Cloud
To compete in today’s fast-paced and competitive market, smaller and newer firms need a powerful platform that will enable them to compete with bigger players, without the heavy investments needed in computer hardware, software and personnel. Download Now
White Paper - Smart Manufacturing for Electronics
This white paper describes a transformative approach to electronics manufacturing made possible by the addition of Mentor Graphics to the Siemens family. It describes a completely digitalized strategy that supports both printed circuit board (PCB) and mechanical design and manufacturing, uniting the entire product lifecycle – from idea and production to customers and back. 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