Book a Demo

Author Topic: importing diagrams from csv  (Read 4050 times)

skuzalbut

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
importing diagrams from csv
« on: August 18, 2011, 10:46:17 pm »
Hi all,

I'm new to this forum and new to EA Sparx.

I am writing vb.net code to import diagrams from csv file, the two fields I have in the csv file is Name (of Element already in repository) and Type (of DiagramObject) I want to add to the diagram.

Basically what is happening when I add the DiagramObjects onto the diagram, I want them to be places evenly spaced so that it is layout nicely.  Currently it just places each of the object on top of one another.

Can anyone give me some pointers to achieve what I want?

Many thanks

Luis J. Lobo

  • EA User
  • **
  • Posts: 252
  • Karma: +0/-0
  • IT Consultant
    • View Profile
Re: importing diagrams from csv
« Reply #1 on: August 18, 2011, 11:12:33 pm »
Hi.

I recommend you to use the auto-layout functionality.

The method:

LayoutDiagramEx (string DiagramGUID, long LayoutStyle, long Iterations, long LayerSpacing, long ColumnSpacing, boolean SaveToDiagram)

...of the "Project" object.

See: http://www.sparxsystems.com/enterprise_architect_user_guide/8.0/automation_and_scripts/project_2.html

kr,

skuzalbut

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: importing diagrams from csv
« Reply #2 on: August 19, 2011, 09:13:15 am »
Hi Kr,

I forgot to mention that I am using EA Sparx 7.5.

I believe the auto layout functionality doesn't work on Behavioral diagrams which is what I have.

Unless I can force EA to do it?  I am not exactly sure how I can do this as there is nothing in the help file/sample code that shows me how to use this functionality.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: importing diagrams from csv
« Reply #3 on: August 19, 2011, 10:32:29 am »
Can't you just set the values of EA.DiagramObject.Left and EA.DiagramObject.Top?
The Sparx Team
[email protected]