blue outline on maps from arcpy.searchcursor

4768
4
Jump to solution
12-04-2015 12:01 PM
PaulFrank
New Contributor II

Hello,

Perhaps this is really an Arcmap question, but I am using arcpy.searchcursor to find new records, perform a definition query on a polygon, and create maps from the polygon outline.  Everything works as intended except after the first map, subsequent maps have a polygon with the blue selection outline.  Ive tried a few things to eliminate this.  One workaround I have considered is creating a new layer from the definition query, and removing the old layer.  I have also changed the options in Arcmap to not use blue as a selection color.

I suppose this has something to do with the searchcursor, but I am not sure how to get around that.

Thanks for looking

Paul Frank

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
DarrenWiens2
MVP Honored Contributor

Without inspecting your script, have you run (or considered running) Select Layer By Attribute, specifying CLEAR_SELECTION as the selection method, to remove the selection from your layer?

View solution in original post

4 Replies
DarrenWiens2
MVP Honored Contributor

Without inspecting your script, have you run (or considered running) Select Layer By Attribute, specifying CLEAR_SELECTION as the selection method, to remove the selection from your layer?

PaulFrank
New Contributor II

Darren,

You helped me figure it out.  I did have the code you suggested but I got to thinking it still had something to do with the surchcursor.  It turns out I needed to move on to the next record before exporting the map, as opposed to after, which is how I had it.

Thanks!

0 Kudos
DarrenWiens2
MVP Honored Contributor

Glad you figured it out. As a postscript, if you're interested and using 10.1+ (I think), you may want to look into using arcpy.da.SearchCursor(). They're faster and don't require "nexting".

0 Kudos
PaulFrank
New Contributor II

Darren,

Now I think you were correct the first time.  I ran it again and my fix didn't work.  So then I looked at it again, and I am using 2 versions of the same layer in this mxd, so I went back and added your code to the other layer, and everything looks correct now.  I am still a little foggy on what is going on but it seems to work.  Again, thanks!

0 Kudos