This project has moved. For the latest updates, please go here.

when I use DxfDocument.AddEntity() to insert a dynamic block , the name is missed.

Dec 14, 2014 at 12:15 PM
Edited Dec 14, 2014 at 12:20 PM
Just like the title, when I use DxfDocument.AddEntity() to insert a dynamic block , the name is missed.
While I use AutoCAD to insert a block or a dxf file, insert command can found all children blocks that the block or the dxf have. I think it is very necessary to save the name of blocks that were inserted. how can i do?
DxfDocument dxf = new DxfDocument();
Insert insert = new Insert(insertBlock, insertBlock.Position);
dxf.AddEntity(insert);
dxf.Save("B.dxf", false);
B.dxf lost the blocks' names.
Coordinator
Dec 15, 2014 at 3:13 PM
Dynamic blocks are not supported, netDxf can read them but you will loose all the parameters, actions, and constrains information they might contain. They will be treated as a common block.

In the case the "insertBlock" is one of those dynamically generated "*U#" remember that all blocks that start with * are for AutoCad internal use only, you cannot create a block that contains any of the following characters \ < > / ? " : ; * | , = ` what you could do is to make a clone giving it a valid name, before making an insert with it.

Daniel