Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

NXOpen Python: Solid Body object on selectable layer invisible?

Creator
Creator

hello,

 

During a copypastebuilder I switch the work part to the "construction" layer and ask what the current state of the construction layer is. 

Then i paste the objects

Switch the work part back to the original, switch the state on the construction layer back to its previous state

Then i move all the solid objects from the construction layer to the solid layer. 

 

Its all works but when its all done the solid is on the solid layer which is visible selectable but the solid body object is invisible. If in NX i do i show all its doesnt show up, i have to turn the solid layer off and on again for it to show up.

 

What can i add to my code to get the solid body to show up right away after the program is run?

 

Thanks!

2 REPLIES 2

Re: NXOpen Python: Solid Body object on selectable layer invisible?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

2 ideas:

 

Make sure the body is not 'blanked' after the move (check the .IsBlanked property).

 

How are you moving the solids from the construction layer to the solid layer? If you are assigning a new layer number to the solid's .Layer property, make sure to call .RedisplayObject as well. Instead of using the object's .Layer property, I'd suggest using the .MoveDisplayableObjects or using a DisplayModification object to move the solids to a new layer. These methods allow you to specify an array of objects, allowing you to move multiple objects in one command and they take care of the display issues.

Re: NXOpen Python: Solid Body object on selectable layer invisible?

Creator
Creator

Cowski1,

 

You are correct. 

Using .MoveDisplayableObjects did exacly what i needed. 

 

But for record, the object wasn't just blanked according to  Ctrl+Shift+B. Before i was using "solidObj.Layer = " and did the solidObj.RedisplayObject. Which gave me the issue i was having.

 

Thank you for your help!