.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cast a DBobject to AcadEntitiy

2 REPLIES 2
Reply
Message 1 of 3
greg.h
554 Views, 2 Replies

Cast a DBobject to AcadEntitiy

We have a 3rd party app that inherits from the AcadEntity class. When picking up an event as a 3d DWF is written, the object is passed and can easily be cast to a DBObject, but when I try and pass this to an AcadEntity, Autocad Crashes.

DBObject dbo =(DBObject) e.Entity; //OK
AcadEntity acadebt = (AcadEntity) dbo; //Crashes

I am assuming this is because the AcadEntity is a COM object really, coming from the VBA classes. Any ideas on how to convert the object??
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: greg.h

You can't cast a managed object to a COM wrapper
or visa verse.

Have a look at the properties of DBObject and see
if you can find the answer.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009

http://www.acadxtabs.com

Introducing AcadXTabs 2010:
http://www.caddzone.com/acadxtabs/AcadXTabs2010.htm

wrote in message news:5937247@discussion.autodesk.com...
We have a 3rd party app that inherits from the AcadEntity class. When picking up an event as a 3d DWF is written, the object is passed and can easily be cast to a DBObject, but when I try and pass this to an AcadEntity, Autocad Crashes.

DBObject dbo =(DBObject) e.Entity; //OK
AcadEntity acadebt = (AcadEntity) dbo; //Crashes

I am assuming this is because the AcadEntity is a COM object really, coming from the VBA classes. Any ideas on how to convert the object??
Message 3 of 3
BillZ
in reply to: greg.h

Don't know if this will help, or if it's even relevant, but I found this to be very useful information on a project I did.

http://through-the-interface.typepad.com/through_the_interface/2007/02/using_the_com_i.html

Bill

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost