mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-20 06:58:56 +00:00
Minor fix
This commit is contained in:
@@ -162,13 +162,13 @@ class MaterialCreator:
|
|||||||
elif material.is_a("IfcMaterialLayerSet"):
|
elif material.is_a("IfcMaterialLayerSet"):
|
||||||
self.create_layer_set(material)
|
self.create_layer_set(material)
|
||||||
elif material.is_a("IfcMaterialProfileSet"):
|
elif material.is_a("IfcMaterialProfileSet"):
|
||||||
pass # TODO
|
pass # TODO
|
||||||
|
|
||||||
def create_usage_definition(self, material):
|
def create_usage_definition(self, material):
|
||||||
if material.is_a("IfcMaterialLayerSetUsage"):
|
if material.is_a("IfcMaterialLayerSetUsage"):
|
||||||
self.create_layer_set_usage(material)
|
self.create_layer_set_usage(material)
|
||||||
elif material.is_a("IfcMaterialProfileSetUsage"):
|
elif material.is_a("IfcMaterialProfileSetUsage"):
|
||||||
pass # TODO
|
pass # TODO
|
||||||
|
|
||||||
def create_single(self, material):
|
def create_single(self, material):
|
||||||
if material.Name not in self.materials:
|
if material.Name not in self.materials:
|
||||||
@@ -214,7 +214,7 @@ class MaterialCreator:
|
|||||||
self.create_new_single(constituent.Material)
|
self.create_new_single(constituent.Material)
|
||||||
self.assign_material_to_mesh(self.materials[constituent.Material.Name])
|
self.assign_material_to_mesh(self.materials[constituent.Material.Name])
|
||||||
new.material = self.materials[constituent.Material.Name]
|
new.material = self.materials[constituent.Material.Name]
|
||||||
new.fraction = constituent.Fraction or 0.
|
new.fraction = constituent.Fraction or 0.0
|
||||||
new.category = constituent.Category or ""
|
new.category = constituent.Category or ""
|
||||||
|
|
||||||
def create_material_list(self, material_list):
|
def create_material_list(self, material_list):
|
||||||
@@ -1888,7 +1888,12 @@ class IfcImporter:
|
|||||||
def add_element_attributes(self, element, obj):
|
def add_element_attributes(self, element, obj):
|
||||||
attributes = element.get_info()
|
attributes = element.get_info()
|
||||||
for key, value in attributes.items():
|
for key, value in attributes.items():
|
||||||
if value is None or isinstance(value, ifcopenshell.entity_instance) or key == "id" or key == "type":
|
if (
|
||||||
|
value is None
|
||||||
|
or isinstance(value, (tuple, ifcopenshell.entity_instance))
|
||||||
|
or key == "id"
|
||||||
|
or key == "type"
|
||||||
|
):
|
||||||
continue
|
continue
|
||||||
attribute = obj.BIMObjectProperties.attributes.add()
|
attribute = obj.BIMObjectProperties.attributes.add()
|
||||||
attribute.name = key
|
attribute.name = key
|
||||||
|
|||||||
Reference in New Issue
Block a user