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?
Solved! Go to Solution.
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.
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!