mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 07:42:44 +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:
|
class IfcCutter:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.ifc_attribute_extractor = None
|
self.selector = ifcopenshell.util.selector.Selector()
|
||||||
self.product_shapes = []
|
self.product_shapes = []
|
||||||
self.background_elements = []
|
self.background_elements = []
|
||||||
self.cut_polygons = []
|
self.cut_polygons = []
|
||||||
@@ -270,10 +270,10 @@ class IfcCutter:
|
|||||||
if element:
|
if element:
|
||||||
if '{{' in variable.prop_key:
|
if '{{' in variable.prop_key:
|
||||||
prop_key = variable.prop_key.split('{{')[1].split('}}')[0]
|
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)))
|
variable_value = eval(variable.prop_key.replace('{{' + prop_key + '}}', str(prop_value)))
|
||||||
else:
|
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
|
text_obj_data[variable.name] = variable_value
|
||||||
return text_obj_data
|
return text_obj_data
|
||||||
|
|
||||||
@@ -293,8 +293,7 @@ class IfcCutter:
|
|||||||
with open(shape_pickle, 'rb') as shape_file:
|
with open(shape_pickle, 'rb') as shape_file:
|
||||||
shape_map = pickle.load(shape_file)
|
shape_map = pickle.load(shape_file)
|
||||||
|
|
||||||
selector = ifcopenshell.util.selector.Selector()
|
products.extend(self.selector.parse(ifc_file, self.cut_objects))
|
||||||
products.extend(selector.parse(ifc_file, self.cut_objects))
|
|
||||||
|
|
||||||
include_elements = []
|
include_elements = []
|
||||||
for i, product in enumerate(products):
|
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)
|
top_left_corner = location - (width / 2 * x_axis) - (height / 2 * y_axis)
|
||||||
ifc_cutter = cut_ifc.IfcCutter()
|
ifc_cutter = cut_ifc.IfcCutter()
|
||||||
import ifccsv
|
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.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.data_dir = bpy.context.scene.BIMProperties.data_dir
|
||||||
ifc_cutter.diagram_name = self.diagram_name
|
ifc_cutter.diagram_name = self.diagram_name
|
||||||
|
|||||||
Reference in New Issue
Block a user