adding MULTILEADER entities

50 views
Skip to first unread message

AlexM

unread,
Oct 4, 2016, 11:02:46 AM10/4/16
to python-ezdxf
I need help trying to access the attributes of a MULTILEADER entity. I have been able to import the entity which was created in AutoCAD but once imported to the DXF drawing I can't modify it. I really need to be able to reproduce this entity with different text at different locations. Can someone help guide me to create a new Graphic Entitiy Class or possibly create an update to the module to include MLEADER or MULTILEADER entitiy support? 

Thanks in advance,
Alex Marrero

Manfred Moitzi

unread,
Oct 4, 2016, 11:53:11 PM10/4/16
to python-ezdxf
Hi!

The MLEADER and the also required MLEADERSTYLE entity is not easy to implement, the description of the DXF attributes of this two entities span over 12 pages in the DXF standard, and as often the description of the attributes is not very precise.

You can use ezdxf/modern/mtext.py or hatch.py as draft, HATCH is better, because HATCH is also a very complex entity (but only 8 pages in the DXF standard).

1. create MLeader and a MLeaderStyle classes in a new module like ezdxf/modern/mleader.py

2. add  this classes in ezdxf/modern/__init__.py to the dict UPDATE_ENTITY_WRAPPERS

3. if you want to create new MLEADER entities, add a add_mleader() method to the GraphicsFactory class in ezdxf/graphicsfactory.py

4. you need much time for testing, because the DXF standard is not strict, you can left out things so DXF entities created by different applications may have different tags

5. if you create entities by yourself: AutoCAD accepts not everything - but gives often unclear error messages or worst case - it just crashes without feedback

Look at hatch.py, implementing a complex entity like MLEADER is not done in a couple of hours - and it is frustrating - therefor I just implement entities which are really needed by users! You are the first who ask for MLEADER.

Best regards,
Manfred
Reply all
Reply to author
Forward
0 new messages