Arcpy to entire dataframe

4366
2
01-27-2015 04:24 PM
ShaneArmour
New Contributor II

Hi,

I'm quite new to arcpy. I found a way to remove all of the layers in a dataframe using arcpy, but i still see the dataframe border on the maps. Is there a way to remove an entire dataframe or remove the dataframe border using arcpy?

Here is my code:

                for lyr in arcpy.mapping.ListLayers(mxd, "", df):

                    arcpy.mapping.RemoveLayer(df,lyr)

Thanks!

Shane

0 Kudos
2 Replies
XanderBakker
Esri Esteemed Contributor

The dataframe does not expose any symbology, so I don't think you can change it: ArcGIS Help (10.2, 10.2.1, and 10.2.2) .

You might want to move the dataframe outside of the page using elementPositionX, elementPositionY and elementHeight and elementWidth of the dataframe, but I still don't understand why you would like to create a blank page...

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

I agree with Xander Bakker‌, i.e., you can't remove all of the data frames from an MXD.  Even through the GUI, you can remove data frames until you get down to the last one, at which point you are not allowed to remove it.

If you want the border of the frame to not be visible, you can go in and change it, just not through ArcPy unfortunately.

0 Kudos