Compare commits
2 Commits
0dee2a8af7
...
0272daed19
| Author | SHA1 | Date | |
|---|---|---|---|
| 0272daed19 | |||
| 89c8530851 |
+16
-2
@@ -76,6 +76,11 @@ def create_block_library(input_dir, output_file, config, logger=None):
|
|||||||
"SWEPTSURFACE",
|
"SWEPTSURFACE",
|
||||||
}
|
}
|
||||||
filtered_entities = []
|
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:
|
for e in entities:
|
||||||
if e.dxftype() in allowed_types:
|
if e.dxftype() in allowed_types:
|
||||||
@@ -191,11 +196,20 @@ def create_block_library(input_dir, output_file, config, logger=None):
|
|||||||
x_offset += max_blockspacing_x
|
x_offset += max_blockspacing_x
|
||||||
# Blockreferenz mit optionalem Layer einfügen (Entity-Layer bleiben erhalten)
|
# Blockreferenz mit optionalem Layer einfügen (Entity-Layer bleiben erhalten)
|
||||||
if blockref_layer:
|
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:
|
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
|
# 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])
|
# 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)})
|
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