Add ability to export parameterised profiles for material profiles.

This commit is contained in:
Dion Moult
2020-01-14 17:38:54 +11:00
parent 8490dc7841
commit 71f836d013
6 changed files with 916 additions and 9 deletions
+18
View File
@@ -22,6 +22,7 @@ ifc_schema = IfcSchema()
diagram_scales_enum = []
products_enum = []
profiledef_enum = []
classes_enum = []
types_enum = []
availablematerialpsets_enum = []
@@ -109,6 +110,13 @@ def getIfcClasses(self, context):
return classes_enum
def getProfileDef(self, context):
global profiledef_enum
if len(profiledef_enum) < 1:
profiledef_enum.extend([(e, e, '') for e in getattr(ifc_schema, 'IfcParameterizedProfileDef')])
return profiledef_enum
def getPersons(self, context):
global persons_enum
if len(persons_enum) < 1:
@@ -219,6 +227,14 @@ def getApplicableMaterialAttributes(self, context):
return materialattributes_enum
def refreshProfileAttributes(self, context):
while len(context.active_object.active_material.BIMMaterialProperties.profile_attributes) > 0:
context.active_object.active_material.BIMMaterialProperties.profile_attributes.remove(0)
for attribute in ifc_schema.IfcParameterizedProfileDef[self.profile_def]['attributes']:
profile_attribute = context.active_object.active_material.BIMMaterialProperties.profile_attributes.add()
profile_attribute.name = attribute['name']
def getApplicableDocuments(self, context):
global documents_enum
documents_enum.clear()
@@ -401,6 +417,8 @@ class BIMMaterialProperties(PropertyGroup):
psets: CollectionProperty(name="Psets", type=Pset)
attributes: CollectionProperty(name="Attributes", type=Attribute)
applicable_attributes: EnumProperty(items=getApplicableMaterialAttributes, name="Attribute Names")
profile_def: EnumProperty(items=getProfileDef, name='Parameterized Profile Def', update=refreshProfileAttributes)
profile_attributes: CollectionProperty(name='Profile Attributes', type=Attribute)
class SweptSolid(PropertyGroup):