AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

delete object data record?

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
436 Views, 0 Replies

delete object data record?

Anonymous
Not applicable
I want to delete the object data record of an entity.The following code can remove the entity's object data record,but when after the code excuted,I cann't do anything with the entity,it also says"the object was already open for write".If I close the dwg file and then open it,it works.Why this happens?Is it a bug of cadmap?
Thanks for any help! Sorry for my poor english!

AcadApplication acadApp = (AcadApplication)System.Runtime.InteropServices.Marshal.GetActiveObject ("AutoCAD.Application");
AutocadMAP.AcadMap map = (AcadMap)acadApp.GetInterfaceObject("AutoCADMap.Application");
AutocadMAP.Project p = map.Projects.Item(0);
AutocadMAP.ODRecords records = p.ODTables.GetODRecords();//
AutocadMAP.ODTable table = null;//

if (records.Init(selectEntity, true , false))//the second var must set to true to remove object data record
{
ODRecord removeRecord = records.Record();
records.Remove();

s = records.Init(selectEntity, false , false);
//close the entity,if don't excute this sentence,the program will give an error
records = null;}
0 Likes

delete object data record?

I want to delete the object data record of an entity.The following code can remove the entity's object data record,but when after the code excuted,I cann't do anything with the entity,it also says"the object was already open for write".If I close the dwg file and then open it,it works.Why this happens?Is it a bug of cadmap?
Thanks for any help! Sorry for my poor english!

AcadApplication acadApp = (AcadApplication)System.Runtime.InteropServices.Marshal.GetActiveObject ("AutoCAD.Application");
AutocadMAP.AcadMap map = (AcadMap)acadApp.GetInterfaceObject("AutoCADMap.Application");
AutocadMAP.Project p = map.Projects.Item(0);
AutocadMAP.ODRecords records = p.ODTables.GetODRecords();//
AutocadMAP.ODTable table = null;//

if (records.Init(selectEntity, true , false))//the second var must set to true to remove object data record
{
ODRecord removeRecord = records.Record();
records.Remove();

s = records.Init(selectEntity, false , false);
//close the entity,if don't excute this sentence,the program will give an error
records = null;}
0 REPLIES 0

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

Post to forums  

Autodesk Design & Make Report