.NET

Reply
New Member
d_gray
Posts: 2
Registered: ‎06-05-2007
Message 1 of 4 (165 Views)

Transaction.GetObject() throwing error

165 Views, 3 Replies
06-05-2007 06:44 PM
Hi,

I am getting the following error when using Transaction.GetObject() command "Operation is not valid due to the current state of the object."

I have an ObjectIdCollection that i loop round and try

Dim ent As aaDS.Entity = CType(t.GetObject(oid, OpenMode.ForRead), aaDS.Entity)

I've used the same line of code a good few times but this morning it's not playing ball and throwing the above error.

Is there any way i can check the current state of the object to find out what is wrong so that i know where to look? Or any pointers in general?

Thanks
*PeterG
Message 2 of 4 (165 Views)

Re: Transaction.GetObject() throwing error

06-08-2007 02:18 AM in reply to: d_gray
Hi.

I'm not sure if this will help but it's worth a try.

Try to lock the document and when you are done dispose the lock.
Autodesk.AutoCAD.ApplicationServices.DocumentLock documentLock =
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.LockDocument();

Regards

Peter



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

I am getting the following error when using Transaction.GetObject() command
"Operation is not valid due to the current state of the object."

I have an ObjectIdCollection that i loop round and try

Dim ent As aaDS.Entity = CType(t.GetObject(oid, OpenMode.ForRead),
aaDS.Entity)

I've used the same line of code a good few times but this morning it's not
playing ball and throwing the above error.

Is there any way i can check the current state of the object to find out
what is wrong so that i know where to look? Or any pointers in general?

Thanks
New Member
d_gray
Posts: 2
Registered: ‎06-05-2007
Message 3 of 4 (165 Views)

Re: Transaction.GetObject() throwing error

06-11-2007 04:54 PM in reply to: d_gray
Thanks Peter, I finally figured out that i hadn't disposed of a transaction!
Active Member
rakeshkava
Posts: 8
Registered: ‎11-13-2007
Message 4 of 4 (165 Views)

Re: Transaction.GetObject() throwing error

12-04-2007 08:19 PM in reply to: d_gray
can i get to know what u exactly did u solve the issue a sample piece of code would be more useful

thanks in advance
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.