TheSwamp

Code Red => .NET => Topic started by: MarioR on August 06, 2014, 04:37:50 AM

Title: Another DWG insert as block in currend dwg, but replace existing blocks
Post by: MarioR on August 06, 2014, 04:37:50 AM
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
Title: Re: Another DWG insert as block in currend dwg, but replace existing blocks
Post by: WILL HATCH on August 06, 2014, 07:24:42 PM
Instead of insert use wblockcloneobjects and set duplicaterecords to manglename