Vorbereitung für Förderer
This commit is contained in:
+17
-3
@@ -76,7 +76,12 @@ def create_block_library(input_dir, output_file, config, logger=None):
|
||||
"SWEPTSURFACE",
|
||||
}
|
||||
filtered_entities = []
|
||||
|
||||
att_def= {}
|
||||
for insert in src_msp.query("INSERT"):
|
||||
for attrib in insert.attribs:
|
||||
att_def[attrib.dxf.tag] = attrib.dxf.text
|
||||
|
||||
|
||||
for e in entities:
|
||||
if e.dxftype() in allowed_types:
|
||||
filtered_entities.append(e)
|
||||
@@ -191,11 +196,20 @@ def create_block_library(input_dir, output_file, config, logger=None):
|
||||
x_offset += max_blockspacing_x
|
||||
# Blockreferenz mit optionalem Layer einfügen (Entity-Layer bleiben erhalten)
|
||||
if blockref_layer:
|
||||
msp.add_blockref(name, insert=(x_offset, y_offset), dxfattribs={"layer": blockref_layer})
|
||||
test =msp.add_blockref(name, insert=(x_offset, y_offset), dxfattribs={"layer": blockref_layer})
|
||||
else:
|
||||
msp.add_blockref(name, insert=(x_offset, y_offset))
|
||||
test =msp.add_blockref(name, insert=(x_offset, y_offset))
|
||||
# Text mit Blocknamen über dem Block
|
||||
if name == "a" or name == "b":
|
||||
for tag, value in att_def.items():
|
||||
|
||||
tag = tag
|
||||
value = value
|
||||
a =test.add_attrib(
|
||||
tag=tag,
|
||||
text=value,
|
||||
)
|
||||
a.is_invisible = True
|
||||
# Werte aus Config holen (Block: [dxf2lib])
|
||||
|
||||
msp.add_text(name, dxfattribs={'height': text_height, 'insert': (x_offset -ausdehnung_x/2 , y_offset + ausdehung_y/2 + extra_text_space_y)})
|
||||
|
||||
Reference in New Issue
Block a user