From 9ee734bc65d58d8f387fa6a9053b0d84d13bcb70 Mon Sep 17 00:00:00 2001 From: Jeremy Mack Wright Date: Tue, 28 May 2019 17:02:09 -0400 Subject: [PATCH] Fixed the script location environment variables not getting exported when running CQGI-compliant script. --- CQGui/Command.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CQGui/Command.py b/CQGui/Command.py index 63dca94..f4c9566 100644 --- a/CQGui/Command.py +++ b/CQGui/Command.py @@ -162,6 +162,10 @@ class CadQueryExecuteScript: if b"show_object(" in scriptText or b"debug(" in scriptText: FreeCAD.Console.PrintMessage("Executing CQGI-compliant script.\r\n") + # Set some environment variables that may help the user + os.environ["MYSCRIPT_FULL_PATH"] = cqCodePane.get_path() + os.environ["MYSCRIPT_DIR"] = os.path.dirname(os.path.abspath(cqCodePane.get_path())) + # A repreentation of the CQ script with all the metadata attached cqModel = cqgi.parse(scriptText)