Is 'rot' attribute in 'txXfrm' autogenerated in a SmartArt?

Regina Henschel 151 Reputation points
2022-07-03T18:18:12.52+00:00

I have tried to manually set the 'rot' attribute in <dsp:txXfrm> element in <dsp:sp> element in a drawing.xml part of SmartArt. I had no success. It is correct, that the value is autogenerated on opening from the relevant <dgm:shape> in the <dgm:layoutNode> in the layout.xml part?

I get:
If the 'rot' attribute of the <dmn:shape> has value n deg, then the 'rot' attribute from the <dsp:txXfrm> element has k 1/60000 deg, with:
315 <= n <= 359 or 0 <= n <= 45 then the 'rot' attribute is missing, meaning k = 0
46 <= n <= 134 then k=-5400000 (-90°)
135 <= n <= 225 then k= 10800000 (180°)
225 <= n <=314 then k= 5400000 (90°)
[for dir = norm]

Is this correct? If yes, is this behavior somewhere documented?

Kind regards,
Regina

Office Open Specifications
Office Open Specifications
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Open Specifications: Technical documents for protocols, computer languages, standards support, and data portability. The goal with Open Specifications is to help developers open new opportunities to interoperate with Windows, SQL, Office, and SharePoint.
127 questions
{count} votes

Accepted answer
  1. Mike Bowen 1,516 Reputation points Microsoft Employee
    2022-07-11T22:20:05.64+00:00

    Hi @Regina Henschel ,

    With SmartArt, rotation is stored relative to the shape while SmartArt uses an absolute rotation for text. This doesn't seem to matter in the majority of SmartArts where the shape and text are the same object, though you can see the txXfrm property preserved with the "Alternating Hexagons" layout, where each node (top-level text bullet) is like a group with nested hexagon shapes that are each rotated 90 degrees:
    219701-image.png
    219692-image.png

    In this example, the hexagon is rotated by 5400000 units, and then the text within it is rotated the inverse of that in order to keep it upright

    As for edits to <dsp:txXfrm/>: In general the drawing#.xml is mostly meant to be a cache of the generated/evaluated layout#.xml using data#.xml, and that cache is overwritten on any recomputation (such as editing the SmartArt or re-saving the document). So, your observation is expected; getting the value to persist would need to be in layout.xml or data.xml.

    Best Regards,

    Mike Bowen
    Escalation Engineer - Microsoft Open Specifications

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Regina Henschel 151 Reputation points
    2022-07-12T14:49:10.96+00:00

    Hi @Mike Bowen ,

    thank you for investigating. The relationship between layout.xml and drawing.xml is clear now.

    0 comments No comments