Jump to content


- - - - -

How to switch on/off "toggle visibility" for each object (curve, surface, ...) in a feature separately?

toggle visibility

  • Please log in to reply
5 replies to this topic

#1 Mr. Vahid Jafari

Mr. Vahid Jafari

    Newbie

  • Members
  • Pip
  • 9 posts
  • LocationAugsburg, Germany

Posted 08 February 2019 - 01:13 PM

Hi everyone,

 

I'm wonking on a feature, which has to create some curves and surfaces as results. Is there any way to make each of these curves and surfaces visible/invisible separately (e.g. through setVisible() function) ? The "Is Drawable" setting on the "General" tab is active. 

 

 

Best Regards,

Vahid


  • 0

#2 Jörg

Jörg

    Moderator

  • Moderators
  • 503 posts
  • LocationBerlin, Germany

Posted 08 February 2019 - 02:06 PM

Hi Vahid,

 

Not sure where you are struggling. Sure, you can call .setVisible(false) for each object, for instance. You can also deactivate the access to these objects in the attributes tab of the definition. Finally, you can create a boolean that you set at each object, and control it through the interface of the feature (input).

bool show(false)

...

object1.setVisible(show)
object2.setVisible(show)
object3.setVisible(show)



  • 0

#3 Mr. Vahid Jafari

Mr. Vahid Jafari

    Newbie

  • Members
  • Pip
  • 9 posts
  • LocationAugsburg, Germany

Posted 08 February 2019 - 02:54 PM

Hi Joerg,

 

As you can see in the attached screenshots, I have a feature called "f1" and it has two curves ("a_Circle" and "bsp") I can switch on/off "toggle visibility" of my feature (f1) in the object tree. But there's no button "toggle visibility" for each of a_Circle and bsp separately. The problem is, if I turn on/off the visibility of "f1", then both a_Circle and bsp will be shown/hidden together. i want to have the possibility to turn on/off each of them individually in the object tree.

 

Best,

Vahid

Attached Thumbnails

  • 01.png
  • 02.png

  • 0

#4 Jörg

Jörg

    Moderator

  • Moderators
  • 503 posts
  • LocationBerlin, Germany

Posted 08 February 2019 - 03:10 PM

If you have several curves in your feature where you want to control the visibility separately, you need Boolean variables as input to this feature. Create a Boolean for each curve, deactivate "allow expression". See the attachment.

 

The button you clicked in your screenshots switches on and off the entire feature object.

Attached Thumbnails

  • bool_visibility.png

  • 0

#5 Mr. Vahid Jafari

Mr. Vahid Jafari

    Newbie

  • Members
  • Pip
  • 9 posts
  • LocationAugsburg, Germany

Posted 11 February 2019 - 09:16 AM

Hi Joerg,

 

Thank you for your reply.

 

That's a goog idea. So I can obviously control the visibility of each curve. But If I have e.g. 15 objects (curves and surfaces etc.) in a feature, do I need to define 15 Boolean variables as argument !!?? Or would you mabe recommend to create an individual feature definition for each object?

 

Best,

Vahid


  • 0

#6 Jörg

Jörg

    Moderator

  • Moderators
  • 503 posts
  • LocationBerlin, Germany

Posted 11 February 2019 - 10:07 AM

Hi Vahid,

 

Depends on your task.

 

Typically, you are interested in a small set of visible geometry objects (from what I have seen so far). During feature definition creation, you can keep all of them visible (for checking them), but once you have finished the definition, make all unnecessary attributes inaccessible - and keep only the most important geometry object accessible.


  • 0