The profile manager now only manages named profiles

This commit is contained in:
Dion Moult
2022-11-10 23:32:01 +11:00
parent 277317e6fd
commit a2362668a3
3 changed files with 4 additions and 2 deletions
@@ -41,7 +41,7 @@ class ProfileData:
@classmethod
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
def profile_classes(cls):
@@ -34,6 +34,8 @@ class LoadProfiles(bpy.types.Operator):
props.profiles.clear()
for profile in tool.Ifc.get().by_type("IfcProfileDef"):
if not profile.ProfileName:
continue
new = props.profiles.add()
new.ifc_definition_id = profile.id()
new.name = profile.ProfileName or "Unnamed"
@@ -41,7 +41,7 @@ class BIM_PT_profiles(Panel):
self.props = context.scene.BIMProfileProperties
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:
row.operator("bim.disable_profile_editing_ui", text="", icon="CANCEL")
else: