habe die Bogen namen ins cofig eingefügt und habe denn namen der layer für die automatisiereung im config geändert um zu verdeutlichen was es tatsächlich ist
This commit is contained in:
+5
-6
@@ -44,8 +44,7 @@ def create_block_library(input_dir, output_file, config, logger=None):
|
||||
max_blockspacing_y = 0
|
||||
|
||||
for filename in os.listdir(input_dir):
|
||||
if filename =='821104043.dxf':
|
||||
test = 2
|
||||
|
||||
if not filename.lower().endswith(".dxf"):
|
||||
continue
|
||||
|
||||
@@ -57,7 +56,7 @@ def create_block_library(input_dir, output_file, config, logger=None):
|
||||
src_doc = ezdxf.readfile(filepath)
|
||||
src_msp = src_doc.modelspace()
|
||||
entities = list(src_msp)
|
||||
allowed_types = {"LINE", "LWPOLYLINE", "POLYLINE", "SPLINE", "CIRCLE", "ARC", "INSERT"}
|
||||
allowed_types = {"LINE", "LWPOLYLINE", "POLYLINE", "SPLINE", "CIRCLE", "ARC", "INSERT","ATTDEF"}
|
||||
filtered_entities = []
|
||||
|
||||
for e in entities:
|
||||
@@ -477,17 +476,17 @@ def get_entity_bounding_box(e, doc,src_doc,filename,config, transform_matrix=Non
|
||||
if sampled:
|
||||
bbox.extend(sampled)
|
||||
|
||||
elif e.dxftype() == 'TEXT':
|
||||
elif e.dxftype() == 'ATTDEF':
|
||||
# Vereinfachung: Nur Insert-Point berücksichtigen
|
||||
insert_point = Vec3(e.dxf.insert)
|
||||
if transform_matrix:
|
||||
insert_point = transform_matrix.transform(insert_point)
|
||||
bbox.extend([insert_point])
|
||||
|
||||
|
||||
elif e.dxftype() == 'INSERT':
|
||||
# INSERT: Block-Inhalt mit Transformation berücksichtigen
|
||||
insert_bbox = calculate_insert_bounding_box(e, doc,src_doc,filename,config, transform_matrix)
|
||||
if insert_bbox and insert_bbox.has_data and e.dxf.layer not in config.get("dxf2lib","not_allowed_in_center"):
|
||||
if insert_bbox and insert_bbox.has_data and e.dxf.layer not in config.get("dxf2lib","automation_layer"):
|
||||
bbox.extend(insert_bbox)
|
||||
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user