mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 14:31:39 +00:00
The profile manager now only manages named profiles
This commit is contained in:
@@ -41,7 +41,7 @@ class ProfileData:
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def total_profiles(cls):
|
def total_profiles(cls):
|
||||||
return len(tool.Ifc.get().by_type("IfcProfileDef"))
|
return len([p for p in tool.Ifc.get().by_type("IfcProfileDef") if p.ProfileName])
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def profile_classes(cls):
|
def profile_classes(cls):
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ class LoadProfiles(bpy.types.Operator):
|
|||||||
props.profiles.clear()
|
props.profiles.clear()
|
||||||
|
|
||||||
for profile in tool.Ifc.get().by_type("IfcProfileDef"):
|
for profile in tool.Ifc.get().by_type("IfcProfileDef"):
|
||||||
|
if not profile.ProfileName:
|
||||||
|
continue
|
||||||
new = props.profiles.add()
|
new = props.profiles.add()
|
||||||
new.ifc_definition_id = profile.id()
|
new.ifc_definition_id = profile.id()
|
||||||
new.name = profile.ProfileName or "Unnamed"
|
new.name = profile.ProfileName or "Unnamed"
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class BIM_PT_profiles(Panel):
|
|||||||
self.props = context.scene.BIMProfileProperties
|
self.props = context.scene.BIMProfileProperties
|
||||||
|
|
||||||
row = self.layout.row(align=True)
|
row = self.layout.row(align=True)
|
||||||
row.label(text="{} Profiles Found".format(ProfileData.data["total_profiles"]), icon="SNAP_GRID")
|
row.label(text=f"{ProfileData.data['total_profiles']} Named Profiles Found", icon="SNAP_GRID")
|
||||||
if self.props.is_editing:
|
if self.props.is_editing:
|
||||||
row.operator("bim.disable_profile_editing_ui", text="", icon="CANCEL")
|
row.operator("bim.disable_profile_editing_ui", text="", icon="CANCEL")
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user