Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Clemo on July 08, 2014, 12:25:29 am

Title: Diagram Layout function from Java
Post by: Clemo on July 08, 2014, 12:25:29 am
Hi,

Is there anyway of calling the diagram layout menu function from the Java API?

Thanks

Clemo
Title: Re: Diagram Layout function from Java
Post by: OpenIT Solutions on July 08, 2014, 01:33:24 am
No. Only a subset of the automation interface has been implemented in the Java API; from memory its also missing the DocumentGenerator classes....
Title: Re: Diagram Layout function from Java
Post by: Aaron B on July 08, 2014, 09:48:16 am
The "Automatic" diagram layout type can be performed via automation by calling LayoutDiagramEx on the Project class.  See:
http://www.sparxsystems.com/enterprise_architect_user_guide/10/automation_and_scripting/project_2.html
 
This function is equivalent to the "Diagram | Layout Diagram" menu command in the EA user interface.  See:
http://www.sparxsystems.com/enterprise_architect_user_guide/10/modeling_basics/layoutadiagram.html
 
Code: [Select]
repository.GetProjectInterface().LayoutDiagramEx(diagram.GetDiagramGUID(), 0, 4, 20, 20, false);
Unfortunately it is not possible to call any of the diagram layout algorithms provided by the "Layout Tools" window in EA via automation at this time (E.g. Circle/Ellipse, Box, Per Page, Digraph, Spring).
Title: Re: Diagram Layout function from Java
Post by: Clemo on July 08, 2014, 04:31:42 pm
Fantastic that is exactly what I wanted.

Thanks

Paul :)
Title: Re: Diagram Layout function from Java
Post by: mcoletti on August 08, 2014, 12:57:45 am
I was meaning InsertText in VB. It works adding a chr(13) in the string. ::)
Title: Re: Diagram Layout function from Java
Post by: OpenIT Solutions on August 19, 2014, 11:30:01 pm
@Aron B :

Re comments on previous post "Unfortunately it is not possible to call any of the diagram layout algorithms provided by the "Layout Tools" window in EA via automation at this time (E.g. Circle/Ellipse, Box, Per Page, Digraph, Spring). "

Don't suppose this has changed with latest release ? I'd love to be able to apply "Circle" layout automatically ??

Regards,

Jon.
Title: Re: Diagram Layout function from Java
Post by: Aaron B on August 20, 2014, 09:41:27 am
No changes as far as I am aware.