Copying Graphic_Element with arcpy

566
6
07-20-2010 12:56 PM
JayDouillard
New Contributor II
As it is impossible to change things such as the color of a graphic_element (say a rectangle) I would like to make a few elements in the colors I need  that I can copy then move, to construct an element of my legend.

Is this possible?

Thanks!
0 Kudos
6 Replies
JeffMoulds
Esri Contributor
GraphicElement class only has these properties:

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/GraphicElement/00s300000040000000/

Color is not an available property. What are you trying to accomplsih?
0 Kudos
DarrylKlassen
New Contributor III
Did you ever find a way to access these properties of an element through arcpy?  I am struggling with this right now as well.  I am trying to create an XML doc of the element on my map and looking to access various characteristics of the elements (color, line thickness, etc) and cannot seem to do it.  I was able to accomplish some of this through VBA in 9.x, but not now through 10.0 and arcpy.

Any help/tips or thoughts would be appreciated.

Thanks
0 Kudos
KimOllivier
Occasional Contributor III
ArcPy is minimalist in philosophy. It is not a VBA/ArcObjects replacement (yet).

You can only change a few basic properties of map elements that are in the properties dialog for an element, such as position. The suggestion is to keep a range of objects off the page in the MXD template and move the required one on to the map.

If you are a wizard at ArcObjects, then anything is possible if you load the comtypes module and call ArcObjects directly. See Mark Cederholm's excellent examples.
http://www.pierssen.com/arcgis/upload/misc/python_arcobjects.pdf
0 Kudos
JayDouillard
New Contributor II
dk,

I have done as kimo suggested, I created objects off to the side of the document, and gave them names "redbox" "greenbox"

I could then move these into position when needed, it works, but it isn't too slick. It can really start to slow down things when it gets too complex.
I really need to learn how to use comtypes or ironpython!!
0 Kudos
DarrylKlassen
New Contributor III
Yes, it looks like we will have to use the comtypes package.  I guess i have to walk up that steep learning curve! 😞
0 Kudos
TedCronin
MVP Honored Contributor
looking to access various characteristics of the elements (color, line thickness, etc) and cannot seem to do it.

Thanks


Sounds like this would be a good thing to put out on the ideas.arcgis.com site.

On Ideas now.  https://c.na1.visual.force.com/apex/ideaView?id=087300000008F2h&returnUrl=/apex/ideaList%3Fc%3D09a30...
0 Kudos