2121import blenderbim .bim .module .type .prop as type_prop
2222from bpy .types import WorkSpaceTool
2323from blenderbim .bim .ifc import IfcStore
24- from blenderbim .bim .module .model .data import WorkspaceData
24+ from blenderbim .bim .module .model .data import AuthoringData
2525
2626
2727class BimTool (WorkSpaceTool ):
@@ -52,19 +52,19 @@ class BimTool(WorkSpaceTool):
5252 )
5353
5454 def draw_settings (context , layout , tool ):
55- if not WorkspaceData .is_loaded :
56- WorkspaceData .load ()
55+ if not AuthoringData .is_loaded :
56+ AuthoringData .load ()
5757
5858 row = layout .row (align = True )
5959 if not IfcStore .get_file ():
6060 row .label (text = "No IFC Project" , icon = "ERROR" )
6161 return
6262 props = context .scene .BIMModelProperties
63- if WorkspaceData .data ["ifc_classes" ]:
63+ if AuthoringData .data ["ifc_classes" ]:
6464 row .prop (props , "ifc_class" , text = "" )
6565 else :
6666 row .label (text = "No IFC Class" )
67- if WorkspaceData .data ["relating_types" ]:
67+ if AuthoringData .data ["relating_types" ]:
6868 row .prop (props , "relating_type" , text = "" )
6969 else :
7070 row .label (text = "No Relating Type" )
@@ -75,7 +75,7 @@ def draw_settings(context, layout, tool):
7575 row .label (text = "" , icon = "EVENT_SHIFT" )
7676 row .label (text = "Add Type Instance" , icon = "EVENT_A" )
7777
78- if not ifc_classes_is_empty :
78+ if AuthoringData . data [ "ifc_classes" ] :
7979 if props .ifc_class == "IfcWallType" :
8080 row = layout .row ()
8181 row .label (text = "Join" )
@@ -147,9 +147,9 @@ def execute(self, context):
147147
148148 def _execute (self , context ):
149149 self .props = context .scene .BIMModelProperties
150- self .ifc_classes_is_empty = True
150+ self .has_ifc_class = True
151151 try :
152- self .ifc_classes_is_empty = bool (self .props .ifc_class )
152+ self .has_ifc_class = bool (self .props .ifc_class )
153153 except :
154154 pass
155155 getattr (self , f"hotkey_{ self .hotkey } " )()
@@ -159,27 +159,27 @@ def hotkey_S_A(self):
159159 bpy .ops .bim .add_type_instance ()
160160
161161 def hotkey_S_C (self ):
162- if not self .ifc_classes_is_empty and self .props .ifc_class == "IfcWallType" :
162+ if self .has_ifc_class and self .props .ifc_class == "IfcWallType" :
163163 bpy .ops .bim .align_wall (align_type = "CENTERLINE" )
164164 else :
165165 bpy .ops .bim .align_product (align_type = "CENTERLINE" )
166166
167167 def hotkey_S_E (self ):
168- if self .ifc_classes_is_empty :
168+ if not self .has_ifc_class :
169169 return
170170 if self .props .ifc_class == "IfcWallType" :
171171 bpy .ops .bim .join_wall (join_type = "T" )
172172 elif self .props .ifc_class in ["IfcColumnType" , "IfcBeamType" , "IfcMemberType" ]:
173173 bpy .ops .bim .extend_profile ()
174174
175175 def hotkey_S_V (self ):
176- if not self .ifc_classes_is_empty and self .props .ifc_class == "IfcWallType" :
176+ if self .has_ifc_class and self .props .ifc_class == "IfcWallType" :
177177 bpy .ops .bim .align_wall (align_type = "INTERIOR" )
178178 else :
179179 bpy .ops .bim .align_product (align_type = "POSITIVE" )
180180
181181 def hotkey_S_X (self ):
182- if not self .ifc_classes_is_empty and self .props .ifc_class == "IfcWallType" :
182+ if self .has_ifc_class and self .props .ifc_class == "IfcWallType" :
183183 if bpy .ops .bim .align_wall .poll ():
184184 bpy .ops .bim .align_wall (align_type = "EXTERIOR" )
185185 else :
0 commit comments