mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-16 21:42:19 +00:00
Allow text annotation formatting functions
This commit is contained in:
@@ -219,7 +219,13 @@ class IfcCutter:
|
|||||||
for variable in text_obj.data.BIMTextProperties.variables:
|
for variable in text_obj.data.BIMTextProperties.variables:
|
||||||
element = self.get_ifc_element(variable.global_id)
|
element = self.get_ifc_element(variable.global_id)
|
||||||
if element:
|
if element:
|
||||||
text_obj_data[variable.name] = self.ifc_attribute_extractor.get_element_key(element, variable.prop_key)
|
if '{{' in variable.prop_key:
|
||||||
|
prop_key = variable.prop_key.split('{{')[1].split('}}')[0]
|
||||||
|
prop_value = self.ifc_attribute_extractor.get_element_key(element, prop_key)
|
||||||
|
variable_value = eval(variable.prop_key.replace('{{' + prop_key + '}}', str(prop_value)))
|
||||||
|
else:
|
||||||
|
variable_value = self.ifc_attribute_extractor.get_element_key(element, variable.prop_key)
|
||||||
|
text_obj_data[variable.name] = variable_value
|
||||||
if text_obj_data:
|
if text_obj_data:
|
||||||
data[text_obj.name] = text_obj_data
|
data[text_obj.name] = text_obj_data
|
||||||
|
|
||||||
|
|||||||
@@ -939,7 +939,6 @@ class IfcImporter():
|
|||||||
and getattr(association.RelatingDocument, value):
|
and getattr(association.RelatingDocument, value):
|
||||||
setattr(reference, key, getattr(association.RelatingDocument, value))
|
setattr(reference, key, getattr(association.RelatingDocument, value))
|
||||||
|
|
||||||
|
|
||||||
def place_objects_in_spatial_tree(self):
|
def place_objects_in_spatial_tree(self):
|
||||||
for global_id, obj in self.added_data.items():
|
for global_id, obj in self.added_data.items():
|
||||||
self.place_object_in_spatial_tree(self.file.by_guid(global_id), obj)
|
self.place_object_in_spatial_tree(self.file.by_guid(global_id), obj)
|
||||||
|
|||||||
+7
-10
@@ -176,16 +176,13 @@ class IfcAttributeExtractor():
|
|||||||
return getattr(element, key)
|
return getattr(element, key)
|
||||||
elif '.' not in key:
|
elif '.' not in key:
|
||||||
return None
|
return None
|
||||||
elif key[0:3] == 'Qto':
|
pset_name, prop = key.split('.')
|
||||||
qto_name, prop = key.split('.')
|
pset = IfcAttributeExtractor.get_element_pset(element, pset_name)
|
||||||
qto = IfcAttributeExtractor.get_element_qto(element, qto_name)
|
if pset:
|
||||||
if qto:
|
return IfcAttributeExtractor.get_pset_property(pset, prop)
|
||||||
return IfcAttributeExtractor.get_qto_property(qto, prop)
|
qto = IfcAttributeExtractor.get_element_qto(element, pset_name)
|
||||||
else:
|
if qto:
|
||||||
pset_name, prop = key.split('.')
|
return IfcAttributeExtractor.get_qto_property(qto, prop)
|
||||||
pset = IfcAttributeExtractor.get_element_pset(element, pset_name)
|
|
||||||
if pset:
|
|
||||||
return IfcAttributeExtractor.get_pset_property(pset, prop)
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Reference in New Issue
Block a user