×
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

NX 7.5 Journaling - General Assembly Question

NX 7.5 Journaling - General Assembly Question

NX 7.5 Journaling - General Assembly Question

(OP)
Hey guys, so I've got funcitons that load in a part and then pulls in a component assembly using the following functions:

Function Load_Part(ByVal filepath1 As String) As Part

Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim unit1 As Unit = CType(workPart.UnitCollection.FindObject("MilliMeter"), Unit)
Dim nullFeatures_Feature As Features.Feature = Nothing

Dim Part1 As Part
Dim Load1 As PartLoadStatus
On Error Resume Next
Part1 = theSession.Parts.Open(filepath1, Load1)

Return Part1

End Function

Function Load_Assembly(ByVal Part1 As part, componentName As String) As Assemblies.Component

Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim unit1 As Unit = CType(workPart.UnitCollection.FindObject("MilliMeter"), Unit)
Dim nullFeatures_Feature As Features.Feature = Nothing

Dim basePoint1 As Point3d = New Point3d(0.0, 0.0, 0.0)
Dim orientation1 As Matrix3x3
orientation1.Xx = 1.0
orientation1.Xy = 0.0
orientation1.Xz = 0.0
orientation1.Yx = 0.0
orientation1.Yy = 1.0
orientation1.Yz = 0.0
orientation1.Zx = 0.0
orientation1.Zy = 0.0
orientation1.Zz = 1.0
Dim partLoadStatus1 As PartLoadStatus
Dim component1 As Assemblies.Component
component1 = workPart.ComponentAssembly.AddComponent(Part1, "MODEL", componentName, basePoint1, orientation1, 7, partLoadStatus1)

Return component1

End Function






So both of these functions work as hoped. They bring in a fully functional component assembly as expected. However, upon bringing the component assembly in, is there any way for me to loop through and process all of the individual features (bodies, planes, points, etc) from the component assembly? Additionally, if that's possible, is there any way to get the "custom name" of the features that one would normally see in the part navigator if this were in the Work Part?


Thanks, any help is greatly appreciated as this has me bashing my head against a wall.

RE: NX 7.5 Journaling - General Assembly Question

You have two possibilities to access objects at the component part.

One is to use the part class methods for collections. This certainly covers points, planes & bodies as collections.

The other method is to change the work part to the component which has the objects of interest and then specific object can be selected in code more directly.

Regards

Frank Swinkels

RE: NX 7.5 Journaling - General Assembly Question

(OP)
Thanks Frank, I changed the work part to get the objects I needed. However, now I'm trying to using those planes, datum axes, and bodies for constraining the assembly component to planes and points in my original work part. Every time that I attempt to use the variables containing planes or axes (etc) from the assembly that I just got, I end up creating constraints that return the alert: "The constraint contains invalid geometry references. New references cannot be added to the constraint until the invalid references have been removed."

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