Can you create a .style with python?

4688
3
Jump to solution
06-30-2015 11:11 AM
ChrisMathers
Occasional Contributor III

I have a spread sheet with a bunch of colors in it and I really dont feel like typing them all in. Can I do this automatically with python? I've opened one and it is a binary file so I would need to know the encoding to use struct on it.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

Arcpy does not offer the possibility to create a new style and create new items. See: StyleItem—Help | ArcGIS for Desktop

For this you would require ArcObjects.

View solution in original post

0 Kudos
3 Replies
XanderBakker
Esri Esteemed Contributor

Arcpy does not offer the possibility to create a new style and create new items. See: StyleItem—Help | ArcGIS for Desktop

For this you would require ArcObjects.

0 Kudos
ChrisMathers
Occasional Contributor III

Geez. Why cant syles just be in json? Always gotta use proprietary formats don't you esri?

XanderBakker
Esri Esteemed Contributor

Would be nice to have that option or access to a finer grained object model in python.

For now you could use ArcObjects in Python (see this example: Create a new MXD through Python. ). For VB code to manipulate the Styles, see this old post: Add a Symbol to the Style Gallery

Or just use VBA ArcObjects if you have the "license" activate on your system.

0 Kudos