mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Fix bug in extracting smart data for annotation tags
This commit is contained in:
@@ -149,7 +149,7 @@ def do_cut(process_data):
|
||||
|
||||
class IfcCutter:
|
||||
def __init__(self):
|
||||
self.ifc_attribute_extractor = None
|
||||
self.selector = ifcopenshell.util.selector.Selector()
|
||||
self.product_shapes = []
|
||||
self.background_elements = []
|
||||
self.cut_polygons = []
|
||||
@@ -270,10 +270,10 @@ class IfcCutter:
|
||||
if element:
|
||||
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)
|
||||
prop_value = self.selector.get_element_value(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)
|
||||
variable_value = self.selector.get_element_value(element, variable.prop_key)
|
||||
text_obj_data[variable.name] = variable_value
|
||||
return text_obj_data
|
||||
|
||||
@@ -293,8 +293,7 @@ class IfcCutter:
|
||||
with open(shape_pickle, 'rb') as shape_file:
|
||||
shape_map = pickle.load(shape_file)
|
||||
|
||||
selector = ifcopenshell.util.selector.Selector()
|
||||
products.extend(selector.parse(ifc_file, self.cut_objects))
|
||||
products.extend(self.selector.parse(ifc_file, self.cut_objects))
|
||||
|
||||
include_elements = []
|
||||
for i, product in enumerate(products):
|
||||
|
||||
@@ -2064,7 +2064,6 @@ class CutSection(bpy.types.Operator):
|
||||
top_left_corner = location - (width / 2 * x_axis) - (height / 2 * y_axis)
|
||||
ifc_cutter = cut_ifc.IfcCutter()
|
||||
import ifccsv
|
||||
ifc_cutter.ifc_attribute_extractor = ifccsv.IfcAttributeExtractor
|
||||
ifc_cutter.ifc_filenames = [i.name for i in bpy.context.scene.DocProperties.ifc_files]
|
||||
ifc_cutter.data_dir = bpy.context.scene.BIMProperties.data_dir
|
||||
ifc_cutter.diagram_name = self.diagram_name
|
||||
|
||||
Reference in New Issue
Block a user