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.
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:
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).
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.
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.
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.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register