mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Block the user from creating sub resources under a subcontract resource.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
# BlenderBIM Add-on - OpenBIM Blender Add-on
|
||||
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
|
||||
#
|
||||
@@ -22,6 +21,7 @@ from blenderbim.bim.ifc import IfcStore
|
||||
from ifcopenshell.api.resource.data import Data
|
||||
import blenderbim.bim.helper
|
||||
|
||||
|
||||
class BIM_PT_resources(Panel):
|
||||
bl_label = "IFC Resources"
|
||||
bl_idname = "BIM_PT_resources"
|
||||
@@ -68,7 +68,12 @@ class BIM_PT_resources(Panel):
|
||||
}
|
||||
|
||||
total_resources = len(self.tprops.resources)
|
||||
if total_resources and self.props.active_resource_index < total_resources:
|
||||
if (
|
||||
total_resources
|
||||
and self.props.active_resource_index < total_resources
|
||||
and Data.resources[self.tprops.resources[self.props.active_resource_index].ifc_definition_id]["type"]
|
||||
!= "IfcSubContractResource"
|
||||
):
|
||||
row = self.layout.row(align=True)
|
||||
for ifc_class, icon in icon_map.items():
|
||||
label = ifc_class.replace("Ifc", "").replace("Construction", "").replace("Resource", "")
|
||||
|
||||
Reference in New Issue
Block a user