Cancel
Showing results for 
Search instead for 
Did you mean: 

Hide object Simtalk

Pioneer
Pioneer

Good morning, I would like to know the sentence in Simtalk to hide an object. In other words the sentence to make as CTRL+H in the 3D model.

6 REPLIES 6

Re: Hide object Simtalk

Siemens Phenom Siemens Phenom
Siemens Phenom

The interactive "Hide Object" functionality only hides objects temporarily to get the out of the way for modelling purposes.

If I guess correctly, you want a way to permanently hide the graphics of an object.

Interactively, this can either be done in the 3D properties dialog with the visible flags in the list of graphic groups or in the context menu of the graphic groups in the graphic structure dialog of an object.

The SimTalk counterparts for this are the method <obj>._3D.hideGraphicGroup(<graphicGroupName>) and the attribute <obj>._3D.VisibleGraphics.

To hide all graphic groups of an object, set <obj>._3D.VisibleGraphics := makeArray();

Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution

Re: Hide object Simtalk

Pioneer
Pioneer

If  the command to hide the object (hiding all its groups) is <obj>._3D.VisibleGraphics := makeArray()

 

What is the command to make it visible again?

Re: Hide object Simtalk

Siemens Phenom Siemens Phenom
Siemens Phenom

The ideal way depends on your application:

  1. The most general version would be
    <obj>._3D.VisibleGraphics := <obj>._3D.GraphicGroupNames
    However, this version is the slowest possible way to do this for Plant Simulation (at least as I would guess it).
  2. If you had a proper visibility state before hiding the graphics, you can use
    <obj>._3D.InheritGraphicVisibilities := true
    which restores the inheritance of the graphic visibility and thus restores the state of the origin in the instance. This is probably the best way considering performance.
  3. If you just had one or few graphic groups and these are always the same and the origin visibilities can't be used for whatever reason, you can use
    <obj>._3D.VisibleGraphics := makeArray("myfirstgraphicgroup", "mysecondgraphicgroup", ...)
    where "myfirstgraphicgroup" etc are the names of your graphic groups.
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution

Re: Hide object Simtalk

Pioneer
Pioneer

Thank you for your answer Peter I have used the command you posted and they work well with objects like Single Proc or Assembly, but when I tried to use them with methods in order to hide their icons in the 3D view I don't know why but the methods are runned. Do you know how to hide the icons of the methods in 3D or what I am doing bad?

 

error ocultar method.png

 

 Thank you

Re: Hide object Simtalk

Siemens Phenom Siemens Phenom
Siemens Phenom

By default, methods are called when they are referenced to in a method.

To avoid this and just reference the method, you use ref() in SimTalk 1.0 or & in SimTalk 2.0.

In your case, instead of the call

.Models.Frame.Reasignar_tareas1._3D.VisibleGraphics := ... ,

you would need

ref(.Models.Frame.Reasignar_tareas1)._3D.VisibleGraphics := ... .

(SimTalk 2.0: .Models.Frame.&Reasignar_tareas._3D.VisibleGraphics := ...)

Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution

Re: Hide object Simtalk

Pioneer
Pioneer

It worksssss!!!!! Thank you very much Peter