Setting boolean properties to True or False via scripting

Hi,
I’m trying to set the visibility of a component to either True or False via a Script Action. This should be very straightforward, but for some reason I cannot get it to work properly.

The META visible flag uses lower case, so I tried true, but it didn’t work. Since it’s uppercase in Python and the built-in Script Console, I tried True, but that didn’t work either.

self.getSibling(“Pump Control”).meta.visible=true
self.getSibling(“Pump Control”).meta.visible=True

If I use 1 and 0 instead of true and false, the statement works, but the property editor highlights the visible property with an error message.

self.getSibling(“Pump Control”).meta.visible=1

bool

Thanks,
Ali

That syntax should work; were you getting an error or was the assignment just not working?

There was no error, but the assignment was not working. I tried again today and now it works. Restarting the designer fixed it. Thank you for verifying the syntax.

1 Like