diff --git a/commands/showUnderconstrained/entry.py b/commands/showUnderconstrained/entry.py index dbcaddf..a12ab44 100644 --- a/commands/showUnderconstrained/entry.py +++ b/commands/showUnderconstrained/entry.py @@ -1,4 +1,5 @@ import adsk.core +import adsk.fusion import os from ...lib import fusionAddInUtils as futil from ... import config @@ -74,5 +75,10 @@ def stop(): def command_created(args: adsk.core.CommandCreatedEventArgs): # General logging for debug. # futil.log(f"{CMD_NAME} Command Created Event") - - app.executeTextCommand("sketch.showunderconstrained") + sketch = adsk.fusion.Sketch.cast(app.activeEditObject) + if not sketch: + ui.messageBox("There is no sketch currently being edited.") + elif sketch.isFullyConstrained: + ui.messageBox("The current sketch is fully constrained.") + else: + app.executeTextCommand("sketch.showunderconstrained") \ No newline at end of file