You can now store arbitrary IFC data in the SVG, depending on the drawing style

This commit is contained in:
Dion Moult
2020-09-02 21:51:58 +10:00
parent 9c8f8ba56f
commit dbbc56ef0d
6 changed files with 101 additions and 12 deletions
+11 -1
View File
@@ -1,4 +1,5 @@
import os
import re
import math
import time
import numpy
@@ -807,8 +808,17 @@ class IfcCutter:
classes = [position, element.is_a()]
for association in element.HasAssociations:
if association.is_a('IfcRelAssociatesMaterial'):
classes.append('material-{}'.format(self.get_material_name(association.RelatingMaterial)))
classes.append('material-{}'.format(
re.sub('[^0-9a-zA-Z]+', '', self.get_material_name(association.RelatingMaterial))
))
classes.append('globalid-{}'.format(element.GlobalId))
for attribute in self.attributes:
result = self.selector.get_element_value(element, attribute)
if result:
classes.append('{}-{}'.format(
re.sub('[^0-9a-zA-Z]+', '', attribute),
re.sub('[^0-9a-zA-Z]+', '', result)
))
return classes
def get_material_name(self, element):