Skip to content

Commit 604a61c

Browse files
committed
Version 1.3.1. Fix error in flat pattern editor. #11
Application.activeEditObject errored in flat pattern editor.
1 parent 33272b2 commit 604a61c

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

DirectName.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"description": {
77
"": ""
88
},
9-
"version": "1.3.0",
9+
"version": "1.3.1",
1010
"runOnStartup": true,
1111
"supportedOS": "windows|mac",
1212
"editEnabled": true

DirectName.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ def command_terminated_handler(args: adsk.core.ApplicationCommandEventArgs):
161161
# self
162162
return
163163

164-
if app_.activeEditObject.classType() == 'adsk::fusion::Sketch':
164+
# Issue #11: app_.activeEditObject gives "RuntimeError: 2 : InternalValidationError : res" in the Flat Pattern environment,
165+
# but calling it on "design" works.
166+
design = adsk.fusion.Design.cast(app_.activeProduct)
167+
if design and design.activeEditObject.classType() == 'adsk::fusion::Sketch':
165168
# Don't activate inside Sketch edit mode, e.g. when the user deletes a line or
166169
# runs a Mirror command.
167170
# Alternative: Track SketchActivate, SketchStop and UndoCommand (note that

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ This project is licensed under the terms of the MIT license. See [LICENSE](LICEN
5252

5353
## Changelog
5454

55+
* v 1.3.1 (June 2024)
56+
* Fix error pop-ups in Flat Pattern editor. #11
5557
* v 1.3.0 (April 2023)
5658
* Options to only name certain types of elements.
5759
* v 1.2.2

0 commit comments

Comments
 (0)