.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

clone named object dictionary

1 REPLY 1
Reply
Message 1 of 2
Anonymous
329 Views, 1 Reply

clone named object dictionary

Hi,

I have been able to clone all objects from one drawing to other, but the contents under nod are not cloned. I used the wblockclone method.Is there an error in this method?

foreach (ObjectId objID in sourceBTR)
{

Entity ent = (Entity)sourceTrans.GetObject(objID, OpenMode.ForRead);
if (ent.Layer != "0")
{
//Add the entity if it is not layer 0 to the object id collection
acObjIdColl.Add(ent.ObjectId);
}


}


IdMapping acIdMap = new IdMapping();

try
{
//Clone objects from source database
sourceDB.WblockCloneObjects(acObjIdColl, destBTR.ObjectId, acIdMap, DuplicateRecordCloning.Ignore, false);

}
catch (Autodesk.AutoCAD.Runtime.Exception ex)
{
ed.WriteMessage("\n Error: " + ex.Message);
}
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

What is it that's under the NOD that you expect to be cloned that is not?
The code you show is simply cloning entities from a BlockTableRecord, so the
only other objects that should be cloned are objects that are hard
referenced, directly or indirectly, by the entities being cloned.

wrote in message news:6230360@discussion.autodesk.com...
Hi,

I have been able to clone all objects from one drawing to other, but the
contents under nod are not cloned. I used the wblockclone method.Is there an
error in this method?

foreach (ObjectId objID in sourceBTR)
{

Entity ent = (Entity)sourceTrans.GetObject(objID,
OpenMode.ForRead);
if (ent.Layer != "0")
{
//Add the entity if it is not layer 0 to the
object id collection
acObjIdColl.Add(ent.ObjectId);
}


}


IdMapping acIdMap = new IdMapping();

try
{
//Clone objects from source database
sourceDB.WblockCloneObjects(acObjIdColl,
destBTR.ObjectId, acIdMap, DuplicateRecordCloning.Ignore, false);

}
catch (Autodesk.AutoCAD.Runtime.Exception ex)
{
ed.WriteMessage("\n Error: " + ex.Message);
}

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost