Fixed a bug where Helpers.show could not be called more than once, and one that kept macros from being used instead of script editor tabs.

This commit is contained in:
Jeremy Mack Wright 2017-04-15 14:48:22 -04:00
parent b72b9f4580
commit 36726d5344
2 changed files with 18 additions and 17 deletions

View File

@ -119,6 +119,9 @@ class CadQueryExecuteScript:
# Grab our code editor so we can interact with it # Grab our code editor so we can interact with it
cqCodePane = Shared.getActiveCodePane() cqCodePane = Shared.getActiveCodePane()
# Clear the old render before re-rendering
Shared.clearActiveDocument()
# Save our code to a tempfile and render it # Save our code to a tempfile and render it
tempFile = tempfile.NamedTemporaryFile(delete=False) tempFile = tempfile.NamedTemporaryFile(delete=False)
tempFile.write(cqCodePane.toPlainText().encode('utf-8')) tempFile.write(cqCodePane.toPlainText().encode('utf-8'))

View File

@ -15,9 +15,7 @@ def show(cqObject, rgba=(204, 204, 204, 0.0)):
# Grab our code editor so we can interact with it # Grab our code editor so we can interact with it
cqCodePane = Shared.getActiveCodePane() cqCodePane = Shared.getActiveCodePane()
# Clear the old render before re-rendering if cqCodePane != None:
Shared.clearActiveDocument()
# Save our code to a tempfile and render it # Save our code to a tempfile and render it
tempFile = tempfile.NamedTemporaryFile(delete=False) tempFile = tempfile.NamedTemporaryFile(delete=False)
tempFile.write(cqCodePane.toPlainText().encode('utf-8')) tempFile.write(cqCodePane.toPlainText().encode('utf-8'))