Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

NXOpen: Component Hidden in Main Assy Tree, but not in Subassy Tree 2

Status
Not open for further replies.

Csaba Solyom

Mechanical
Sep 22, 2016
14
Hello,

NX version: 1919 (Build 3400)

I'm writing some script that interacts with parts in multi-level assemblies, based on whether they are hidden (Blanked) or not.
Starting point is usually the "root" main assembly, that has several subassemblies containing parts, and occasionally sub-subassemblies.

My issue is that the component.IsBlanked() property doesn't reliably tell my script, whether the part is hidden or not for the user.
If the user hides a part in the main assembly's tree, it will still be "visible" - IsBlanked = FALSE - in the subassembly's ComponentAssembly.

This leads to some confusion for my users, since to them the part looks hidden, but the script isn't doing what they expect.

Is there a way to check a parts "visibility status" that circumvents this issue?

Thanks,
 
Replies continue below

Recommended for you

The component in the main assembly is NOT the same as the component in the subassembly; check the tags, you will see they are different. I suspect that you will need to use either MapComponentFromParent or MapComponentsFromSubassembly to get what you want.

www.nxjournaling.com
 
@cowski

Thank you, I managed to solve the issue using MapComponentsFromSubassembly.
In case it helps someone in the future:
I compare the Work Part and the Display Part (Session.Parts.Work & Session.Parts.Display) - if the two differ, and both are assemblies (ComponentAssembly.RootComponent != Nothing), use the displayPart.MapComponentsFromSubassembly(workPart.[...].child)(i) to get back the correct component.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor