You'll probably need to take a look here to begin with: MoveLayer—Help | ArcGIS Desktop
While your at it, get familiar with: MapDocument—Help | ArcGIS Desktop & ListLayers—Help | ArcGIS Desktop
Hi Joe,
I looked at the links and I not quite sure if those links are able to rearrange fields in the layer properties. I am importing several FC layers into a fresh map document and I was hoping to change the attribute field order in which they will appear. I know we can change them manually but I was hoping there would be a way in python to rearrange the field order and save the map document, similar to importing FC layers and saving. I'll provide the code and image below.
import os
import arcpy # if outside ArcMap
# inside ArcMap, use "CURRENT" for document name
mxd = arcpy.mapping.MapDocument(r"C:\Users\jnmiller\Desktop\Rebuild Map py Scripts\Untitled.mxd")
# Input Variables
#
path = r"C:\Users\jnmiller\AppData\Roaming\ESRI\Desktop10.6\ArcCatalog\SDE.sde" # path source w/layers
df = arcpy.mapping.ListDataFrames(mxd, "*")[0]
# Add layer to TOC
#
fullPath = os.path.join(path, "ProposedMainlineProjects\ProposedMainlineProjects")
addLayer = arcpy.mapping.Layer(fullPath)
arcpy.mapping.AddLayer(df, addLayer, "BOTTOM")
fullPath = os.path.join(path, "P_PipeSystem\P_Meters")
addLayer = arcpy.mapping.Layer(fullPath)
arcpy.mapping.AddLayer(df, addLayer, "BOTTOM")
fullPath = os.path.join(path, "P_PipeSystem\P_MeterSetting")
addLayer = arcpy.mapping.Layer(fullPath)
arcpy.mapping.AddLayer(df, addLayer, "BOTTOM")
fullPath = os.path.join(path, "P_PipeSystem\P_Regulator")
addLayer = arcpy.mapping.Layer(fullPath)
arcpy.mapping.AddLayer(df, addLayer, "BOTTOM")
# Set Visable = False
#
for lyr in arcpy.mapping.ListLayers(mxd):
print lyr.name
lyr.visible = False
mxd.save()
del mxd
I'm sorry, I guess I got my wires crossed when I read "...order for layers in the ArcGIS Desktop 10.6 Table of Contents". Now I understand what you really would like to do. I just googled 'arcpy reorder fields'. Give that a shot: there are several returns.