.NET

.NET

Reply
Active Member
WangYanbin
Posts: 9
Registered: ‎12-29-2006
Message 1 of 1 (40 Views)

A problem of adding entities from one Database from another.

40 Views, 0 Replies
01-06-2007 03:31 AM
I met a problem when I get Entities form db1 and write them into db2.The exception is :
Autodesk.AutoCAD.Runtime.Exception: eInvalidInput;
Autodesk.AutoCAD.Runtime.Interop.ThrowExceptionForErrorStatus(Int32 errorStatus);
Autodesk.AutoCAD.DatabaseServices.BlockTableRecord.AppendEntity(Entity entity);

DBTransMan tm1;
DBTransMan tm2;
Transaction myT1;
Transaction myT2;
BlockTable bt1;
BlockTable bt2;
Database db1;
Database db2;
DBObjectCollection dboc1;
//Custom function to get all entity from db1
dboc1=GetEntityCollectionFrom(db1);
//Add dboc1 to db2;
for(int i=0;i {
//This line throw an exception
btr2.AppendEntity(ee);
tm2.AddNewlyCreatedDBObject((Entity)dboc1, true);
}
myT2.Commit();

I developed this with vs.net 2003 and autocad2006,Thanks a lot!
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.