mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 10:11:46 +00:00
Add ability to export parameterised profiles for material profiles.
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user