00001 class ArchWorkbench(Workbench): 00002 "Arch workbench object" 00003 Icon = """ 00004 /* XPM */ 00005 static char * arch_xpm[] = { 00006 "16 16 9 1", 00007 " c None", 00008 ". c #543016", 00009 "+ c #6D2F08", 00010 "@ c #954109", 00011 "# c #874C24", 00012 "$ c #AE6331", 00013 "% c #C86423", 00014 "& c #FD7C26", 00015 "* c #F5924F", 00016 " ", 00017 " ", 00018 " # ", 00019 " ***$# ", 00020 " .*******. ", 00021 " *##$****#+ ", 00022 " #**%&&##$#@@ ", 00023 ".$**%&&&&+@@+ ", 00024 "@&@#$$%&&@@+.. ", 00025 "@&&&%#.#$#+..#$.", 00026 " %&&&&+%#.$**$@+", 00027 " @%&+&&&$##@@+", 00028 " @.&&&&&@@@ ", 00029 " @%&&@@ ", 00030 " @+ ", 00031 " "}; 00032 """ 00033 MenuText = "Arch" 00034 ToolTip = "Architecture workbench" 00035 00036 def Initialize(self): 00037 import draftTools,draftGui,Arch_rc,Arch 00038 archtools = ["Arch_Wall","Arch_Structure","Arch_Cell", 00039 "Arch_Floor","Arch_Building","Arch_Site", 00040 "Arch_Window", 00041 "Arch_SectionPlane","Arch_Add","Arch_Remove"] 00042 drafttools = ["Draft_Line","Draft_Wire","Draft_Rectangle", 00043 "Draft_Polygon","Draft_Arc", 00044 "Draft_Circle","Draft_Dimension", 00045 "Draft_Move","Draft_Rotate", 00046 "Draft_Offset","Draft_Upgrade", 00047 "Draft_Downgrade"] 00048 meshtools = ["Arch_SplitMesh","Arch_MeshToShape", 00049 "Arch_SelectNonSolidMeshes","Arch_RemoveShape"] 00050 self.appendToolbar("Arch tools",archtools) 00051 self.appendToolbar("Draft tools",drafttools) 00052 self.appendMenu(["Architecture","Tools"],meshtools) 00053 self.appendMenu("Architecture",archtools) 00054 self.appendMenu("Drafting",drafttools) 00055 FreeCADGui.addIconPath(":/icons") 00056 FreeCADGui.addLanguagePath(":/translations") 00057 FreeCADGui.addPreferencePage(":/ui/archprefs-base.ui","Arch") 00058 FreeCAD.addImportType("Industry Foundation Classes (*.ifc)","importIFC") 00059 FreeCAD.addExportType("Wavefront OBJ - Arch module (*.obj)","importOBJ") 00060 try: 00061 import collada 00062 except: 00063 Log("pycollada not found, no collada support\n") 00064 else: 00065 FreeCAD.addImportType("Collada (*.dae)","importDAE") 00066 FreeCAD.addExportType("Collada (*.dae)","importDAE") 00067 Log ('Loading Arch module... done\n') 00068 def Activated(self): 00069 FreeCADGui.draftToolBar.Activated() 00070 Msg("Arch workbench activated\n") 00071 def Deactivated(self): 00072 FreeCADGui.draftToolBar.Deactivated() 00073 Msg("Arch workbench deactivated\n") 00074 00075 FreeCADGui.addWorkbench(ArchWorkbench) 00076 FreeCADGui.updateLocale() 00077