Yes, you need a managed wrapper 😉
Data Extraction by default, discards properties whose Category is "Misc" (the default category), so to make your managed wrapper's properties show up in Dx, you need to set the category to something other than that, and you should also add the UnitType attribute for double type properties.
In AsdkSimpleSquare.h, add the Category and UnitType attributes to the properties of the SimpleSquare's managed wrapper, like so:
[code]
//========= begin excerpt from AsdkSimpleSquare.h ============
// Declaration of the properties (get and set)
// for what we want to expose to the managed world.
[System::ComponentModel::CategoryAttribute("Geometry")] // pointless, see below
__property Point3d get_Center();
__property void set_Center(Point3d point);
[System::ComponentModel::CategoryAttribute("Geometry")]
[Autodesk::AutoCAD::DatabaseServices::UnitTypeAttribute(UnitType::Angle)]
__property double get_Rotation();
__property void set_Rotation(double rotation);
[System::ComponentModel::CategoryAttribute("Geometry")]
[Autodesk::AutoCAD::DatabaseServices::UnitTypeAttribute(UnitType::Distance)]
__property double get_SideLength();
__property void set_SideLength(double sidelength);
__property void set_Normal(Vector3d normal);
__property Vector3d get_Normal();
//========= end excerpt from AsdkSimpleSquare.h ============
[/code]
Rebuild the project, and you will see the Rotation and SideLength properties show up in Data Extraction.
Unfortunately, Data Extraction isn't very intelligent when it comes to properties that are 3d points (e.g., Point3d), and doesn't convert them to individual properties (one for each component) automatically.
So, insofar as coordinate types go, if you need to expose them to Dx, you can remedy that in one of two ways:
1. Explicitly expose seperate properties of type double, for X, Y and Z components of coordinate properties (less desirable).
2. Implement a "Per-instance property provider" (a managed class that implements the IPropertyProvider interface from Autodesk.AutoCAD.ComponentModel, which BTW, they didn't bother to document), and have it expose whatever properties you want for the custom object. IPropertyProvider and the custom property attributes show above, together function as a managed equivalent of what you might use IDynamicProperty2 for providing properties to the OPM for. This is the preferred solution, although it has downside of providing properties universally (e.g., they will also show up in a PropertyGrid when the managed wrapper is set to the SelectedObject, which is a problem). You can also resort to dirty tricks like examining the call stack, to see if your IPropertyProvider is being called by Data Extraction, or by something else, and act accordingly.
The UnitType attribute is how you tell DataExtraction and other managed components that use System.ComponentModel, what type of data a double represents (e.g., a distance, angle, area, volume, etc.), so they can format those values accordingly.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
wrote in message news:5847976@discussion.autodesk.com...
Dear Developers
I have written a custom entity and exposed its properties via a com wrapper. I now want to link those properties to a Acad data table. I read up on the data extraction wizard, but when I select my object it doesn’t show any of my properties. I suspect I need to implement a managed wrapper as well. However, I tried to do the data extraction wizard on the SimpleSquare example (that does contain a com wrapper) but it still doesn’t show up in the data extraction wizard. Any advice?