-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathFreeCAD-OpenEMS-Export.FCMacro
28 lines (22 loc) · 1 KB
/
FreeCAD-OpenEMS-Export.FCMacro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!python3
# FreeCAD-OpenEMS-Export Launcher Macro Instructions:
# * It is recommended to clone the repository into a sub-folder of Macro named "FreeCAD-OpenEMS-Export"
# (Windows default Macro directory: C:\Users\<your_user_name>\AppData\Roaming\FreeCAD\Macro)
# Macro
# |_FreeCAD-OpenEMS-Export.FCMacro (a copy of this file)
# |_FreeCAD-OpenEMS-Export (repository directory)
# |_FreeCAD ExportOpenEMSDialog.py
# ...
import importlib
import os
import sys
import inspect
FILE_PATH = os.path.realpath(__file__) # full path of this file
FILE_DIR = os.path.split(FILE_PATH)[0] # directory of this file
FOE_MOD_NAME = "ExportOpenEMSDialog"
FOE_MOD_PATH = os.path.join(FILE_DIR, "FreeCAD-OpenEMS-Export/ExportOpenEMSDialog.py") # construct path to target file w.r.t. to this file
FOE_spec = importlib.util.spec_from_file_location(FOE_MOD_NAME, FOE_MOD_PATH)
FOE_mod = importlib.util.module_from_spec(FOE_spec)
FOE_spec.loader.exec_module(FOE_mod)
dlgPanel = FOE_mod.ExportOpenEMSDialog()
dlgPanel.show()