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

Managed Entity to Managed Custom Entity

1 REPLY 1
Reply
Message 1 of 2
namin
390 Views, 1 Reply

Managed Entity to Managed Custom Entity

I created a custom DBX entity, and a managed C++ wrapper. I can use my managed wrapper to create instance of my custom entity from .NET. However, when I get back my instance via the object id, the .NET runtime type isn't that of my custom managed wrapper, but that of the parent (AutoCAD) class. How can I make sure an object id or AcadObject is really of a certain custom class and then attempt to transform it to one?

I'll appreciate any hints. Thanks.
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: namin

Your managed wrapper class must have the the
[Autodesk::AutoCAD::Runtime::Wrapper] attribute
(which specifies the native C++ class name of the
custom object class that is being wrapped).

Additionally, when the DBX housing your native
custom object class is loaded, it must instantiate
an array of AcMgObjectFactory<> instances which
what actually creates the wrapper instances.

See polysamp\managed\main.cpp in the SDK samples
for an example of the latter.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5490128@discussion.autodesk.com...
I created a custom DBX entity, and a managed C++ wrapper. I can use my managed wrapper to create instance of my custom entity from .NET. However, when I get back my instance via the object id, the .NET runtime type isn't that of my custom managed wrapper, but that of the parent (AutoCAD) class. How can I make sure an object id or AcadObject is really of a certain custom class and then attempt to transform it to one?

I'll appreciate any hints. Thanks.

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