Jump to content
Mr. Vahid Jafari

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

Recommended Posts

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

Share this post


Link to post
Share on other sites

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)


Share this post


Link to post
Share on other sites

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

post-1090-0-01684100-1549637616_thumb.png

post-1090-0-90146100-1549637629_thumb.png

Share this post


Link to post
Share on other sites

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.

post-8-0-48727900-1549638603_thumb.png

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...