Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Tom C on March 11, 2010, 05:58:59 am

Title: Automating Diagram Commands
Post by: Tom C on March 11, 2010, 05:58:59 am
I am creating new diagrams through the automation interface. I have a couple of questions:

1) Is there a way to Open the Diagram once it is created through the automation interface?

2) Is there a way to set properties that are not specified in the Help such as the Diagram Property "Show Namespace"?

3) Is there a way to automate the Layout of the Diagram through the automation interface?

Thanks for any help you may be able to provide.
Title: Re: Automating Diagram Commands
Post by: Geert Bellekens on March 11, 2010, 03:53:52 pm
Tom,

1: Use Repository.OpenDiagram

2: Look in the Diagram.Style type properties. These properties contain magic strings ("setting1=value;setting2=value;...") that can be edited.

3: Look into the Project Interface, I think there are some methods there to autolayout a diagram.

Geert
Title: Re: Automating Diagram Commands
Post by: Tom C on March 12, 2010, 02:24:18 am
Geert,

1) This worked great. Thanks.

2) There is a StyleEx and an ExtendedStyleEx property for the diagram, but they are both empty string after the diagram is created. I found a general Diagram option "Disable fully scoped object names" that I turned off, but this is a system wide option.

3) Thanks for pointing me to the Project Interface. I was able to use the LayoutDiagramEx method and this will give us a good start to formatting the diagram.

Thanks again for all of your help.

Tom