Release of ezdxf v1.3.5 #1218
mozman
announced in
Announcements
Replies: 4 comments 2 replies
-
I don’t quite understand how construction works using multi-line text in an attribute? import ezdxf
doc = ezdxf.new(dxfversion="R2018")
block = doc.blocks.new(name="MY_BLOCK")
block.add_attdef("TAG1", (0, 0), "Default Value", height=0.25)
block.add_attdef("TAG2", (0, -1), "Another Default", height=0.25)
msp = doc.modelspace()
insert = msp.add_blockref("MY_BLOCK", insert=(5, 5))
attribs = {
"TAG1": "Value\n 1",
"TAG2": "Value\n 2",
}
insert.add_auto_attribs(attribs)
doc.saveas("example.dxf") |
Beta Was this translation helpful? Give feedback.
0 replies
-
Here is an example how to create a multiline ATTDEF: import ezdxf
doc = ezdxf.new(dxfversion="R2018")
block = doc.blocks.new(name="MY_BLOCK")
# Text, location and height not needed, because copied from MTEXT entity
attdef = block.add_attdef("TAG1")
# Define the multiline attribute as MTEXT entity
mtext = block.add_mtext("Default Value", dxfattribs={"char_height": 0.25})
mtext.set_location((0, 0))
# Set ATTDEF content from MTEXT entity
attdef.set_mtext(mtext)
attdef = block.add_attdef("TAG2", (0, -1))
# reuse existing MTEXT entity
mtext.text = "Another Default"
mtext.set_location((0, -1))
# Set ATTDEF content from MTEXT entity and destroy the MTEXT entity
attdef.embed_mtext(mtext)
# Usage of add_auto_attribs() with multiline ATTDEFs:
msp = doc.modelspace()
insert = msp.add_blockref("MY_BLOCK", insert=(5, 5))
attribs = {
"TAG1": "TAG1-Line1\nTAG1-Line2",
"TAG2": "TAG2-Line3\nTAG2-Line4",
}
insert.add_auto_attribs(attribs)
doc.saveas("block_with_multiline_attdef.dxf") |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thank you very much for your efforts. Everything works, I will use it |
Beta Was this translation helpful? Give feedback.
0 replies
-
odafc.win_exec_path = (
"C:\\Program Files\\ODA\\ODAFileConverter 24.10.0\\ODAFileConverter.exe"
)
if not odafc.is_installed():
Check for installation of ODA File Converter stopped working in 1.3.5 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Version 1.3.5 - 2024-12-15
ezdxf.blkrefs.find_unreferenced_blocks()
function returns the names of unused block definitionsAuditor
checks if modelspace and active paperspace existsInsert.add_auto_attribs()
methodODAFC
path dynamically fromezdxf.options
OpenSCAD
path dynamically fromezdxf.options
_AbstractLayout.rename()
, unused method without implementation and documentationBlocksSection.delete_block()
will not delete layout blocks in safe mode.Beta Was this translation helpful? Give feedback.
All reactions