diff --git a/src/blenderbim/blenderbim/bim/module/model/data.py b/src/blenderbim/blenderbim/bim/module/model/data.py index 46b87bcff0..508079681c 100644 --- a/src/blenderbim/blenderbim/bim/module/model/data.py +++ b/src/blenderbim/blenderbim/bim/module/model/data.py @@ -90,7 +90,7 @@ class AuthoringData: @classmethod def type_thumbnail(cls): - if not cls.props.relating_type_id: + if not cls.data["relating_types_ids"]: return 0 element = tool.Ifc.get().by_id(int(cls.props.relating_type_id)) return cls.type_thumbnails.get(element.id(), None) or 0 @@ -221,7 +221,8 @@ class AuthoringData: @classmethod def relating_types_browser(cls): - return cls.relating_types(ifc_class=cls.props.ifc_class_browser) + if cls.data["ifc_classes"]: + return cls.relating_types(ifc_class=cls.props.ifc_class_browser) @classmethod def new_constr_class_info(cls, ifc_class): diff --git a/src/blenderbim/blenderbim/bim/module/model/ui.py b/src/blenderbim/blenderbim/bim/module/model/ui.py index 7750befda9..e7f90de964 100644 --- a/src/blenderbim/blenderbim/bim/module/model/ui.py +++ b/src/blenderbim/blenderbim/bim/module/model/ui.py @@ -20,7 +20,7 @@ import bpy import blenderbim.tool as tool from bpy.types import Panel, Operator, Menu from blenderbim.bim.module.model.data import AuthoringData, ArrayData, StairData, SverchokData, WindowData, DoorData -from blenderbim.bim.module.model.prop import store_cursor_position +from blenderbim.bim.module.model.prop import store_cursor_position, get_ifc_class from blenderbim.bim.module.model.stair import update_stair_modifier from blenderbim.bim.module.model.window import update_window_modifier_bmesh from blenderbim.bim.module.model.door import update_door_modifier_bmesh @@ -40,11 +40,9 @@ class LaunchTypeManager(bpy.types.Operator): def invoke(self, context, event): props = context.scene.BIMModelProperties props.type_page = 1 - if props.ifc_class: + if get_ifc_class(None, context): props.type_class = props.ifc_class bpy.ops.bim.load_type_thumbnails(ifc_class=props.ifc_class, offset=0, limit=9) - if not AuthoringData.is_loaded: - AuthoringData.load() return context.window_manager.invoke_popup(self, width=550) def draw(self, context):