1

I'm trying to hack a Python script together that simulates the "Copy Layout..." that's in the context menu when you right-click a Schematics diagram in ArcMap.

If I copy the Shape and Rotation (for non-linear features) attributes from one diagram to the other, the diagram will visually update and looks great, but then if I do "Update Diagram..." and click through that, the diagram reverts to its former look.

If I use the "Copy Layout..." tool, the diagram does not revert to its former look after doing an "Update Diagram..." So there must be a step in addition to copying the Shape and Rotation to seal the deal, as it were.

Any suggestions?

edit:

Here's a relevant portion of the code that shows how I'm copying the Shape and Rotation.

        with arcpy.da.UpdateCursor(targetFeatureClass, field_names=sourceFields, where_clause=whereClause) as cursor:
            for row in cursor:
                schKey = '{},{},{}'.format(row[idxUGUID], str(row[idxDCLID]), str(row[idxDOID]))
                vals = sourceValues.get(schKey)
                if vals != None:
                    row[idxShape] = vals[idxShape]
                    if idxRotation > 0:
                        row[idxRotation] = vals[idxRotation]
                    cursor.updateRow(row)

This code works as intended, by copying the shape and rotation from one diagram to another. What it doesn't do is make those changes stick after going through the "Update Diagram..." dialog in ArcMap.

  • 1
    Can you edit your question to include a code snippet that illustrates what you are trying to do and where you are stuck, please? – PolyGeo Oct 20 '15 at 0:12
1

Disclaimer: this is not an ESRI-approved answer. I don't know what they think about it.

After editing the Shape and Rotation, I also set the attribute 'UpdateStatus' to 1. After doing that, the "Update Diagram..." tool does not reset the Shape and Rotation, but it does set 'UpdateStatus' back to 0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.