Send a feature to a map using Python

2903
13
Jump to solution
10-30-2014 10:30 AM
StephenEldridge
New Contributor III


I have python script that creates a point feature class.  How do I send that feature to an existing map using Python?

13 Replies
StephenEldridge
New Contributor III

Yes it's on a network and I will have to try it locally and work from there.

0 Kudos
StephenEldridge
New Contributor III

Got the same error message.

0 Kudos
DanPatterson_Retired
MVP Emeritus

haven't played around with adding to arcmap and arcpy mapping when it is not open, however, I see a potential issue.  The help file suggests that when using wildcards

for df in arcpy.mapping.ListDataFrames(mxd, "t*"😞

you cycle through the list (even if it is one entry) without slicing.  Your script  uses

df = arcpy.mapping.ListDataFrames(mxd, "Update")[0]

and the error message suggests that there are no dataframes called "Update", so you might check this and/or use a wildcard "Update*" to see if that works.  That is what the index out of range means there is no first entry in the list and the list is empty

StephenEldridge
New Contributor III

Found the error to be the dataframe was not named properly in the properties of the mxd.

0 Kudos