AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

display the object data in a dataGrid- Vb.Net

10 REPLIES 10
Reply
Message 1 of 11
newautocad123
1839 Views, 10 Replies

display the object data in a dataGrid- Vb.Net

How can I display the object data of a layer in table format, with VB.net

10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: newautocad123

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.

 

http://adndevblog.typepad.com/infrastructure/2012/03/exporting-dwg-to-sdf-using-epf-file-using-map-3...

 

http://adndevblog.typepad.com/infrastructure/2012/04/export-dwg-to-sdf-using-autodeskgismapimportexp...


Thanks,

 

Message 3 of 11
newautocad123
in reply to: Anonymous

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.

Message 4 of 11
Anonymous
in reply to: newautocad123

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 :

 

http://adndevblog.typepad.com/infrastructure/2012/05/how-to-create-fdo-feature-using-geospatial-plat...

 

http://adndevblog.typepad.com/infrastructure/2012/05/inserting-fdo-features-into-sql-server-using-ge...


Does it help ?

 

Thanks,

Message 5 of 11
norman.yuan
in reply to: newautocad123

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

Drive CAD With Code

EESignature

Message 6 of 11
newautocad123
in reply to: 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:

FeatIdFeatId1OBJECTIDcitycodeCitynamecountrymintempmaxTempPopulationlatlong
24313567735677101Delhi India24810000077.1128.4
24353567835678102BangaloreIndia63228900078.113.2
24393567935679103LondonUK101647800079.09-2
24433568035680104newYorkUS14066700080.08-17.2
24473568135681105AustinUS18-1685600081.07-32.4
24513568235682106BerlinGermany22-32104500082.06-47.6
Message 7 of 11

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.

Message 8 of 11
norman.yuan
in reply to: newautocad123

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

Drive CAD With Code

EESignature

Message 9 of 11
norman.yuan
in reply to: newautocad123

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

Drive CAD With Code

EESignature

Message 10 of 11
newautocad123
in reply to: 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.

Message 11 of 11
newautocad123
in reply to: norman.yuan

Please explain "you can simply create a class hold the data for each row and then place all data ".

 

Thanks.

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

Post to forums  

Autodesk Design & Make Report

”Boost