Book a Demo

Author Topic: Setting Swimlane Orientation  (Read 5544 times)

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Setting Swimlane Orientation
« on: January 27, 2015, 10:48:37 am »
I'm writing a jscript to automatically create diagrams for a number of objects in a package. In the diagram I need some horizontal swim lanes. I've managed to create the diagrams and the swim lanes but having trouble setting the orientation to horizontal. By default its vertical.
Does anyone have any advice on setting the orientation of swim lanes in a diagram.
Here is a snippet of code of what I've got so far

Code: [Select]
...
      var motivationDiagram as EA.Diagram;
      motivationDiagram = theElement.Diagrams.AddNew( "Motivation (Who, Why & What)", "Motivation Diagram" );
      var swimlane as EA.Diagram.Swimlane;
      swimlane = motivationDiagram.SwimlaneDef.Swimlanes.Add("Stakeholders", 200);
      swimlane.Orientation=1;
      motivationDiagram.Update();
...

[/color]
I've tried strings like "Horizontal" and numbers like 0 and 1 but get object doesn't support this property. What I'm I doing wrong?
Happy to help
:)

Aaron B

  • EA Administrator
  • EA User
  • *****
  • Posts: 941
  • Karma: +18/-0
    • View Profile
Re: Setting Swimlane Orientation
« Reply #1 on: January 27, 2015, 11:45:09 am »
Orientation should be set on the SwimlaneDef object, not the Swimlane itself.  Example:

Code: [Select]
motivationDiagram.SwimlaneDef.Orientation = 1;Valid values are 0 or 1.  You can also find enum values for these in "Local Scripts.EAConstants-JScript" (See: soVertical, soHorizontal).
« Last Edit: January 27, 2015, 11:45:49 am by AaronB »

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Setting Swimlane Orientation
« Reply #2 on: January 27, 2015, 07:57:53 pm »
Thanks Aaron - appreciate the quick response. You are a good bloke.
Happy to help
:)