.NET

.NET

Reply
Active Member
9 Posts
0 Kudos
Registered: ‎12-29-2006
Post 1 of 1

A problem of adding entities from one Database from another.

42 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
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!