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: 

Error on RemoveRecord

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
407 Views, 2 Replies

Error on RemoveRecord

I am trying to remove the OD record from an object, but keep getting a Mapexception error on the GetObjectTableRecords.

 

Dim myTables As Autodesk.Gis.Map.ObjectData.Tables = Autodesk.Gis.Map.HostMapApplicationServices.Application.ActiveProject.ODTables

Dim table As Autodesk.Gis.Map.ObjectData.Table= myTables("MyTable")

 

Dim recs As Autodesk.Gis.Map.ObjectData.Records

recs = table.GetObjectTableRecords(0, ent.ObjectId, Autodesk.Gis.Map.Constants.

OpenMode.OpenForWrite, True)

 

Dim ie AsIEnumerator

ie = myRec.GetEnumerator

ie.MoveNext()

myRec.RemoveRecord()

myRec.Dispose()

2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

I just started working with VB.NET and AutoCAD Map 3D myself, so I'm not sure how helpful I can be, but I'll try :-).

 

If you put the GetObjectTableRecords call inside a Try...Catch block, can you get any more details about the error?  Or perhaps try to figure out how to use the Autodesk.AutoCAD.Runtime.Exception class to get more information on the error.

 

My guess would be that your ent.ObjectID is not set correctly, but that's all it is, a guess.

Message 3 of 3
Anonymous
in reply to: Anonymous

Actually, it looks like my two suggestions are really the same.  It seems like you would use:

 

Try
	recs=table.GetObjectTableRecords(0, ent.ObjectID, Autodesk.Gis.Map.Constants.OpenMode.OpenForWrite, True)
Catch MyException as Autodesk.AutoCAD.Runtime.Exception
	'use MyException properties and methods to display info on the error here
End Try

 

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

Post to forums  

Autodesk Design & Make Report

”Boost