×
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

NXOpen: Exception when accessing RootComponent of a partially loaded Assembly

NXOpen: Exception when accessing RootComponent of a partially loaded Assembly

NXOpen: Exception when accessing RootComponent of a partially loaded Assembly

(OP)
Hi,

we are trying to analyze a loaded assembly and provide all contained parts and subassemblies to an external tool via NXOpen.
Currently we are using NX9.
Normally this works perfectly using the GetChildren() method from the RootComponent of a given part.
Something like:
...
Dim dispPart As Part = theSession.Parts.Display
Dim c As ComponentAssembly = dispPart.ComponentAssembly
if not IsNothing(c.RootComponent) then
    For Each child As Component In comp.GetChildren()
        'Do something with child
    Next
end if
...
 
In my understanding accessing RootComponent should either be Nothing for piece parts or the component of the given part.
Apparently this is not always the case especially when using the "load partially"-Option.

In some assemblies (but not in all!) I get the following Exception (in german ...) when trying to access the RootComponent:
NXOpen.NXException: Teil ist nur teilweise geladen
   bei NXOpen.Assemblies.ComponentAssembly.get_RootComponent()
   bei NXJournal.Main(String[] args) in C:\Users\horstm\AppData\Local\Temp\NXJournals6424\journal.vb:Zeile 15.
 
Should translate to: Part is only loaded partially.

Question 1: Does anybody have any experience with this behaviour?
Question 2: Is there another way to get the children of a partially loaded part (i.e. without accessing the RootComponent)?

Many thanks

JH

RE: NXOpen: Exception when accessing RootComponent of a partially loaded Assembly

Dim root As Component = theSession.Parts.Display.ComponentAssembly.RootComponent
If Not root Is Nothing Then ...

RE: NXOpen: Exception when accessing RootComponent of a partially loaded Assembly

(OP)

Quote (daluigi)

Dim root As Component = theSession.Parts.Display.ComponentAssembly.RootComponent
If Not root Is Nothing Then ...

The problem is that I get an exception on some partially loaded assemblies when accessing RootComponent in that way.
So i need to have an alternative (if any exists that is).

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