How can I display the object data of a layer in table format, with VB.net
Hi,
There is a C++ Sample in the Map 3D SDK : Map ObjectARX SDK 2013\Map Samples\ODView
You can try converting the same to VB.NET.
You could also use the export API and convert the DWG entities with object data to SDF file format which by defult shows the attribute in tabular format.
Thanks,
My requirement is to edit this layer and add more data, with the table displayed. In short how to add the newly added point/line to that sdf file and add the object data to it. we should also be able to edit the features.
I tried the code suggested, but run into string to double conversion errors.
Thanks.
If the layers are FDO data layer, then you can use Map 3D Platform API to create / insert new FDO features. Please see the following code snippets :
Does it help ?
Thanks,
Adding ObjectData to map objects on FDO layer? Impossible. ObjectData is attribute data attached to AutoCAD native entities, which cannot be attached to map object on FDO map layers.
Maybe you meant FDO Feature Data that you can get from FDO source (SDF file in your cose) and/or data catptured via form/table by user and be updated to FDO source?
If it is latter, indeed ParthaPS just pointed out the samples coming with AutoCAD Map ObjectARX SDK: Platform API.
Norman Yuan
I need to display the object data and also edit it, ie. add new points and also move and edit the data of the existing points. Example of the data display :
I have a city layer with the following data:
FeatId | FeatId1 | OBJECTID | citycode | Cityname | country | mintemp | maxTemp | Population | lat | long |
2431 | 35677 | 35677 | 101 | Delhi | India | 2 | 48 | 100000 | 77.11 | 28.4 |
2435 | 35678 | 35678 | 102 | Bangalore | India | 6 | 32 | 289000 | 78.1 | 13.2 |
2439 | 35679 | 35679 | 103 | London | UK | 10 | 16 | 478000 | 79.09 | -2 |
2443 | 35680 | 35680 | 104 | newYork | US | 14 | 0 | 667000 | 80.08 | -17.2 |
2447 | 35681 | 35681 | 105 | Austin | US | 18 | -16 | 856000 | 81.07 | -32.4 |
2451 | 35682 | 35682 | 106 | Berlin | Germany | 22 | -32 | 1045000 | 82.06 | -47.6 |
how can I insert new data to it. Adding a point ok. but all the related attributes to the city layer also need to be added.
How do you get the object data? It looks like the object data is imported from some kind of FDO feature. Just make sure you do know the differernces of FDO data and object data, considering the question you asked previously.
Assume that you do know how to retrieve the object data from entities (points, in your case?), to display it in a tablet format, you need to create a form and then use control, such as ListView or GridView (assume you use Windows.Forms namespace). To use GridView, you can simply create a class hold the data for each row and then place all data in a IList collection, such as List<MyClass>. Then, you can simply set GridView.DataSource=MyDataList. Well, all this is based on assuption that you do know the basic windows form development with VB.NET or C#.
Norman Yuan
To added ObjectData to a newly added AutoCAD entity (point in your case), you use ObjectData API provided in ManagedMapApi.dll, namely:
Table.AddRecord(ObjectData.Record record, ObjectId entityId)
Since you said all attribute data also need to be added to "city layer", are this a map layer, from a FDO source? If so, why you need both Map layer based on FDO and ObjectData, that you need to update both ObjectData and a map layer/FDO data (yes, you can if really needed)? Make sure you do know when to use ObjectData, when to use FDO feature data and when to use both.
Norman Yuan
I am new to autocad development (worked on arcobjects +.Net +j2ee). hence when to use ObjectData, when to use FDO feature data and when to use both is not that clear to me.
I need to display the city layer data (.shp)as a table, also be able to edit it and also add new points to it.
The approach I need to follow is add the .shp file through shp or add the .shp and display the object data in a datagrid.
Please suggest the best approach, and also any examples that I can follow, to retrieve data to display in the grid, add and also edit.
Please explain "you can simply create a class hold the data for each row and then place all data ".
Thanks.
Please explain "you can simply create a class hold the data for each row and then place all data ".
Thanks.