Cancel
Showing results for 
Search instead for 
Did you mean: 

Columns of part navigator in UG NX are not updating after running a NX Open tool

Experimenter
Experimenter

I have created a auto layer correction tool. As the tool runs, the layers of the objects are modied. But the layer column in the part navigator is not updating after the tool runs. I need to separately off the column and the on it again to get the updated layers. Can anyone help me with how to update the coulmns automatically.

 

I am using C# for coding in NX Open.

4 REPLIES 4

Re: Columns of part navigator in UG NX are not updating after running a NX Open tool

PLM World Member Legend PLM World Member Legend
PLM World Member Legend

Hi @DivyaReddy 

 

How do you move the objects in the different layer? Using NXOpen API or Wrapper functions.

Are you executing the tool in the assembly context?

 

I have tested with simple tool and the layer numbers are updated in the column. I used the following APIs to check that.

 

NXOpen API: Session.GetSession.Parts.Work.Layers.MoveDisplayableObjects(.....)

Wrapper API: UFSession.GetUFSession.Obj.SetLayer(...)

 

Try to use the above methods and check the columns are updating.

 

Re: Columns of part navigator in UG NX are not updating after running a NX Open tool

Experimenter
Experimenter

I am directly assigning the layer to the displayable object as object.Layer=Required Layer Number.

 

Is this the correct way or do i need to change it to any of the methods you mentioned?

Re: Columns of part navigator in UG NX are not updating after running a NX Open tool

Siemens Phenom Siemens Phenom
Siemens Phenom

Did you redisplay the object as suggested in the NXOpen.DisplayableObject.Layer documentation?

 

After setting the layer, you must call RedisplayObject  in order for the change to take effect, except see the comments for NXOpen.DisplayableObject.Color .

 

Re: Columns of part navigator in UG NX are not updating after running a NX Open tool

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Alternately, you can use a DisplayModification object to move geometry to a different layer; it will take care of the update when you call the .Apply method. The display modification object will allow you to modify multiple objects in one call, possibly simplifying your code.