Hi everyone,
I have a lot of mxd files with guidelines in every mxd. i wonder if there is a way with arcpy, to clear all those guidelines at once ?
in ArcGIS Help (10.2, 10.2.1, and 10.2.2) , ArcGIS Help (10.2, 10.2.1, and 10.2.2) ,
i didn't saw any mention for what i seeking.
Thanks in advance.
Hi YYC,
I bet resetting you normal.mxt would do the trick, but it will also reset all the other interface customizations you made, such as non-default placement of menus, etc. It's worth a try though, since if you just rename the current one and it doesn't work, you can always put it back to the current by renaming it back. It's also a very quick test.
Curtis Price Covers how to reset in his blog:
Hi Rebecca,
i tried delete the normal mxt but it didn't remove the guide lines- thanks any way
Bummer...it was just a guess.
thanks anyway
AFAIK, the only way to access guides inside a specific mxd is through ArcObjects, which you can access through comtypes/Snippets (see here for more).
I don't believe deleting your Normal.mxt will do anything to an existing mxd, but I can't test that at the moment.
This will remove the vertical guides from an mxd, if you have comtypes and Snippets properly installed - you can do the same for horizontal guides:
from comtypes.client import GetModule, CreateObject from Snippets import GetLibPath, InitStandalone def main(): InitStandalone() modCarto = GetModule(r"C:\Program Files (x86)\ArcGIS\Desktop10.2\com\esriCarto.olb") snapGuide = CreateObject(modCarto.SnapGuides, interface=modCarto.ISnapGuides) mxdObject = CreateObject(modCarto.MapDocument, interface=modCarto.IMapDocument) mxdObject.Open(r"C:\junk\guides.mxd") snapGuide = mxdObject.PageLayout.VerticalSnapGuides snapGuide.RemoveAllGuides() mxdObject.Save() del mxdObject if __name__ == '__main__': main()
Hi Darren
unfortunately i don't know ArcObjects yet.