1

I have a Python script that creates layers in ArcMap. The script works fine, but when a new layer is created a map is always automatically drawn, which makes the script take longer to process. I really don't need the layers to be drawn on the map. Is there any way to set my script to not draw the layers after they have been created?

During a search I found a similar question: How to disable and enable drawing in ArcMap using Python?

Attempting that solution did not work; "No module named SendKeys"

I'm using ArcGIS 10.2 for Desktop.

  • No, ArcMap is responding to the event that's raised by adding a layer. You can turn off your display but that makes the screen grey and I'm not sure you can do that in python. – Michael Stimson Jul 2 '14 at 22:46
2

To do this:

  1. Turn off the layer in your map
  2. Save your layer as a layer file
  3. Add the layer file to your map - it will come in with the visible property set to False

If you want to do all of this from code then setting the visible property on the new layer object to False before you add it to your map will make it just as easy to do.

  • The map will redraw (probably) with a not visible layer added but at least you wont see it... that's the whole point isn't it? Why add the layer in the first place? Layers work just fine even if they're not added to the document. – Michael Stimson Jul 2 '14 at 23:39
  • @MichaelMiles-Stimson I'm guessing the asker wants to save the draw time at the outset but have it ready to turn on with a single click when more convenient later. – PolyGeo Jul 2 '14 at 23:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.