Select to view content in your preferred language

How do I get display styles from an MXD file?

2861
2
07-16-2010 12:50 PM
BobCave
Emerging Contributor
I have written some ArcObjects code to get the maps, layers, feature classes, geometry, attributes, etc. from an .mxd file (using a MapDocument object).  I also need to get the style information (colors, line styles, etc.).  I have been looking through the ArcObjects documentation, but I can't figure out where I can access that information.  It seems like it ought to be associated with the layer in some way, but I can't find it.

Can someone please point me in the right direction? 

Thank you.

Bob
0 Kudos
2 Replies
GregRieck
Frequent Contributor
Hi Bob,

In ArcGIS 10 if you go to Customize -> Style Manager you can see the Styles that are currently in use with your MXD. Here you can also create a new style by clicking on Styles... and then Create New Style. Often if your data is specific to a particular database you should just create your own style and add it to the styles when needed.

You can do the same thing in 9.3 with Tools -> Styles -> Styles Manager.

Hope that helps.

G
0 Kudos
BobCave
Emerging Contributor
Thanks for the reply. 

I am trying to read the style information using ArcObjects outside of any ArcGIS application (i.e., my application is not an ArcMap or ArcCatalog extension), so I am looking for the classes or interfaces I need to use.  I can open the .mxd file and read the feature classes, spatial references, etc., but I have not been able to figure out how to read style information.  The documentation says that styles are stored in the .mxd file, but I can't figure out how to get them.

Cheers,

Bob
0 Kudos