Author Topic: Another DWG insert as block in currend dwg, but replace existing blocks  (Read 1777 times)

0 Members and 1 Guest are viewing this topic.

MarioR

  • Newt
  • Posts: 64
Hello,

i insert a extern dwg in my current dwg:
Code: [Select]
                string blockName = Path.GetFileNameWithoutExtension(blockPfadName);
                using (Database acBlockDatabase = new Database(false, true))
                {
                    acBlockDatabase.ReadDwgFile(blockPfadName, FileOpenMode.OpenTryForReadShare, true, "");
                    acBlockDatabase.CloseInput(true);
                    if (transaction.StartTransaction())
                    {
                        acBTRId = transaction.AcDatabase.Insert(blockName, acBlockDatabase, true);
                        return true;
                    }
                }

But the extern dwg contains also blocks. On insert this dwg as block print AutoCAD messages like
"Double defination of Block 1234 ignored"

How i can replace the "nested Blocks" from extern dwg into current dwg?

regards Mario

WILL HATCH

  • Bull Frog
  • Posts: 450
Re: Another DWG insert as block in currend dwg, but replace existing blocks
« Reply #1 on: August 06, 2014, 07:24:42 PM »
Instead of insert use wblockcloneobjects and set duplicaterecords to manglename