From inside a parameter expression, is there a way to check if a parent.SHORTCUT exists?
Thanks in advance
From inside a parameter expression, is there a way to check if a parent.SHORTCUT exists?
Thanks in advance
hasattr( parent, “shortcut”) should work. It might catch some other attribute but should be ok?
Thank you. Works fine
For a more general solution you may also look at tdu.tryExcept:
Example:
tdu.tryExcept(lambda: 1/me.par.w, 0.0) # second argument is simply 0.0