isActive Method in Python Commands
Posted: Fri Jan 14, 2022 1:55 pm
In the c++ version of Gui/Command, there is a method isActive that returns true if the command is available for use. Does this method work in Python commands? Mine does not seem to get executed.
Code: Select all
#does isActive work in python commands?
def isActive(self):
"""Return True when the command should be active or False when it should be disabled (greyed)."""
print("isActive")
if App.ActiveDocument:
print("have ActiveDocument")
return havePage() and haveView()
else:
return False