-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathat_create_environment_config.py
33 lines (26 loc) · 1.1 KB
/
at_create_environment_config.py
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
29
30
31
32
33
import FreeCAD, FreeCADGui
import environment_config
from arch_texture_utils.resource_utils import iconPath
import arch_texture_utils.qtutils as qtutils
class CreateEnvironmentConfigCommand:
toolbarName = 'ArchTexture_Environment_Tools'
commandName = 'Create_Environment_Config'
def GetResources(self):
return {'MenuText': "Create Environment Config",
'ToolTip' : "Create a new EnvironmentConfig object to store environment textures",
'Pixmap': iconPath('CreateEnvironmentConfig.svg')
}
def Activated(self):
environment_config.createEnvironmentConfig()
def IsActive(self):
"""If there is no active document we can't do anything."""
return not FreeCAD.ActiveDocument is None
if __name__ == "__main__":
command = CreateEnvironmentConfigCommand();
if command.IsActive():
command.Activated()
else:
qtutils.showInfo("No open Document", "There is no open document")
else:
import archtexture_toolbars
archtexture_toolbars.toolbarManager.registerCommand(CreateEnvironmentConfigCommand())