txt.text = row.getValue("filedName") rect.elementHeight = txt.elementHeight + 0.1
mxd = arcpy.mapping.MapDocument("current") lyr = arcpy.mapping.ListLayers(mxd)[0] rect = arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT", "rect")[0] txt = arcpy.mapping.ListLayoutElements(mxd, "TEXT_ELEMENT", "txt")[0] cur = arcpy.SearchCursor(lyr) row = cur.next() txt.text = row.getValue("filedName") rect.elementHeight = txt.elementHeight + 0.1 arcpy.RefreshActiveView()
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.