.NET

Reply
Valued Contributor
newautocad123
Posts: 58
Registered: ‎09-03-2012
Message 1 of 11 (575 Views)

display any attribute object data on the dwg file

575 Views, 10 Replies
09-26-2012 04:34 AM

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.

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 2 of 11 (553 Views)

Re: display any attribute object data on the dwg file

09-26-2012 11:44 AM in reply to: newautocad123

You may get more help by posting a small example file showing the imported data.

Valued Contributor
newautocad123
Posts: 58
Registered: ‎09-03-2012
Message 3 of 11 (536 Views)

Re: display any attribute object data on the dwg file

09-26-2012 08:46 PM in reply to: newautocad123

the output required is as below:

 

city-dwg.jpg

 

 

 

Valued Contributor
newautocad123
Posts: 58
Registered: ‎09-03-2012
Message 4 of 11 (535 Views)

Re: display any attribute object data on the dwg file

09-26-2012 08:51 PM in reply to: newautocad123

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:

 

FeatIdFeatId1OBJECTIDcitycodeCitynamecountrymintempmaxTempPopulationlatlong
24313567735677101DelhiIndia24810000077.1128.4
24353567835678102BangaloreIndia63228900078.113.2
24393567935679103LondonUK101647800079.09-2
24433568035680104newYorkUS14066700080.08-17.2
24473568135681105AustinUS18-1685600081.07-32.4
24513568235682106BerlinGermany22-32104500082.06-47.6
Valued Mentor
gasty1001
Posts: 438
Registered: ‎04-11-2010
Message 5 of 11 (528 Views)

Re: display any attribute object data on the dwg file

09-26-2012 09:29 PM in reply to: newautocad123

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

 

 

 

 

Valued Contributor
newautocad123
Posts: 58
Registered: ‎09-03-2012
Message 6 of 11 (525 Views)

Re: display any attribute object data on the dwg file

09-26-2012 10:03 PM in reply to: newautocad123

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.

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 7 of 11 (510 Views)

Re: display any attribute object data on the dwg file

09-27-2012 04:28 AM in reply to: newautocad123

When I said small example file, I meant a DWG file containing some of the data, not a JPEG image of it.

*Expert Elite*
norman.yuan
Posts: 946
Registered: ‎04-27-2009
Message 8 of 11 (501 Views)

Re: display any attribute object data on the dwg file

09-27-2012 07:05 AM in reply to: newautocad123

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.

Valued Contributor
newautocad123
Posts: 58
Registered: ‎09-03-2012
Message 9 of 11 (487 Views)

Re: display any attribute object data on the dwg file

09-27-2012 10:21 PM in reply to: DiningPhilosopher

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.

 

 

ADN Support Specialist
Balaji_Ram
Posts: 660
Registered: ‎03-21-2011
Message 10 of 11 (443 Views)

Re: display any attribute object data on the dwg file

10-05-2012 09:22 AM in reply to: newautocad123

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

 



Balaji
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community