Select to view content in your preferred language

Text Updates with Arcpy slow if text is in a group_element

72
0
Friday
HansRasmussen
Occasional Contributor

Hullo.  On the latest greatest ArcGISpro 3.5.  I have a project layout that has several text element in its title block that are updated with an Arcpy script.  If the text elements are grouped witht he rest of the title block, it takes about 2 seconds to update each element.  If they are not grouped at all, the update happens neatly instantly.  I would like them grouped as I need to move the title block around to accommodate different plot sizes.  So this is slow...

HansRasmussen_0-1748036147943.png

and this is fast....

HansRasmussen_1-1748036180490.png

the code that populates the text elements looks like......

 

text_values = {
"CP": f"CP: {cp}",
"BCGS": f"BCGS: {mapsheet}",
"District": f"Resource District: {district}",
"Region": f"Resource Region: {region}",
"TSA": f"TSA: {tsa}",
"PSYU": f"PSYU: {psyunum} - {psyu}",
"FIZ": f"Forest Inventory Zone: {fiz}",
"Latitude": f"Latitude: {printlat}",
"Longitude": f"Longitude: {printlong}",
"Albers": "Albers: " + str(utm_East) + " " + str(utm_North),
"Declination": f"Decl: {declfin}",
"Date Drawn": f"Date Drawn: {drawndate}",
"Stampdate": "Date Stamped: " ,
"Gross": grosslist + '\n\r' + "Total" + "{:21.1f} {:16.1f}".format(nartotarea, grossarearnd),
"NAR": narlist,
"SS": sslist + '\n\r' + " "
}

text_elements = [elm for elm in l.listElements("TEXT_ELEMENT") if elm.name in text_values]

for elm in text_elements:
elm.text = text_values[elm.name]
logging(elm.name)

Any ideas?

 

Thanks

H

0 Kudos
0 Replies