Book a Demo

Author Topic: Automating Diagram Commands  (Read 3469 times)

Tom C

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Automating Diagram Commands
« 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.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Automating Diagram Commands
« Reply #1 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

Tom C

  • EA Novice
  • *
  • Posts: 14
  • Karma: +0/-0
    • View Profile
Re: Automating Diagram Commands
« Reply #2 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