I have imported a shp to dwg. it has the object data attibutes.
Suppose I have a point for cities shp imported to dwg. The attribute has name of the city. How can I display the name of the city to each point on the layer of dwg file.
Thanks.
You may get more help by posting a small example file showing the imported data.
I have a city layer with the following data. It was exported to the dwg file along with the attribute data. now for editing/ working with this file the labels(it can be name of the city) has to be displayed along with the point. Like the above image for the data as:
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 |
Hi,
I'm not sure as the AutoCAD .NET API have a lot of undocumented "things", but I think the only way to read Objectdata is using the MAP API (and so a MAP based product), which have an example of using ObjectData, it also have an API to deal with shape files (and a lot of other GIS related features).
If the data is in the form of attributes then there is a lot of examples of how to deal with, just search for attribute in this forum or in the swamp (http://www.theswamp.org).
Also, please, make clear the input of your problem (blocks with attributes, points with OD, hyperlinks, etc) and the output required (a table, a file, etc).
Gaston Nunez
my input is points with OD and my output is more on the display side,; ie view the one attribute(name of the city) along with the points. It need not be saved in the .dwg file also. Just be displayed when needed, with some plugins.
When I said small example file, I meant a DWG file containing some of the data, not a JPEG image of it.
ObjectData is specific topic only applies to AutoCAD Map/Civil.
Reading/writing data from/to ObjectData is done via AcadMap's COM API (32-bit AutoCAD Map only) and Acad Map ObjectARX API (C++ or .NET).
You can download AutoCAD Map ObjectARX SDK (note: MAP ObjectARX SDK, which is different from AutoCAD ObjectARX SDK for vanilla AutoCAD), then you can find .NET code sample of manipulating ObjectData. The sample is very straightforward, and is better than waiting someone write some code for you here. The document coming with the SDK also shows quite some code snippets on ObjectData programming tasks.
Norman Yuan
please find the city.dwg attached.
Went through the examples for Reading the objectdata attributes. They can be displayed in a grid or any form with .net. But I did not get any example as how a particular attribute related to a point can be displayed on the screen as a text on the screen.
It might be more relevant to post this question in the Map discussion forum, if you have not already done it.
http://forums.autodesk.com/t5/AutoCAD-Map-3D-Developer/bd-p/84
please suggest whether it is possible or not. With FDO connection labels can be display.
programmatically can I display the labels of object data.
Thanks.