One shortcoming of the automation interface (AI) is the lack of properties and methods for setting/modifying the visual attributes of diagrams and diagram objects. For example, how do you set a diagram automatically generated by the AI to display element aliases using only the AI? Or, how do you set an AI-generated diagram object to display using rectangle notation, again using only the AI?
There are workarounds for these examples, but they are less than optimal. For the first case, you can modify the key-value pair in the diagrams' ExtendedStyle attribute to UseAlias=1. However, it seems that ExtendedStyle is empty when the diagram is first created by the AI, so it is necessary to set the complete ExtendedStyle string, e.g.
diagram.ExtendedStyle = "HideRel=0;ShowTags=1;ShowReqs=0;ShowCons=0;OpParams=1;ShowSN=0;ScalePI=0;PPgs.cx=1;PPgs.cy=1;PSize=119;ShowIcons=1;SuppCN=0;HideProps=0;HideParents=0;UseAlias=1;HideAtts=0;HideOps=0;HideStereo=0;HideEStereo=0;FormName=;"in order to accomplish this. (Note that the example also turn tags on and sets the page size to 11x17.)
For the second example, there is an undocumented DiagramObject method SetStyleEx. Rectangle notation can be turned on for a diagram object as follows:
diagramObject.SetStyleEx("UCRect", "1")But it is unclear whether this is a "for Sparxians only" method or if the documentation hasn't yet caught up. Note that setting the StyleEx property directly is not straightforward since EA stores a DUID field, unique for each diagram object, in the StyleEx column.
Sparx should provide documented SetStyleEx methods (or equivalent) for both diagrams and diagram objects that allow any diagram/diagram object attributes that can be set in the GUI to be set using the AI.