Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Sankar on March 06, 2012, 07:24:54 pm

Title: swimlane class
Post by: Sankar on March 06, 2012, 07:24:54 pm
Hi, Can someone provide code snippet for creating a swinlane in a diagram using vbscript. Thanks in advance
Title: Re: swimlane class
Post by: qwerty on March 06, 2012, 08:37:11 pm
Never used that but RTFM showed Diagram.Swimlanedef is what you're looking for.

q.
Title: Re: swimlane class
Post by: Sankar on March 06, 2012, 08:41:55 pm
Thanks for the response,

I am trying

dim obj
                                    
set obj = eaDiagram.SwimlaneDef.Swimlanes.Add("Incident Manager", "Width=700; Height=200")
 eaDiagram.SwimlaneDef.Update()            
This is Type Mismatch, but how do I cast Swimlane object?

Regards

Sankar            
                                    
Title: Re: swimlane class
Post by: qwerty on March 07, 2012, 03:46:46 am
I guess it simply does not work (not unusual for EA). I tried the following
Code: [Select]
my $d = $rep->GetDiagramByGuid ('{ED94B3F2-8E2B-45cd-93DA-40A2FC9AAB96}');
my $sldef = $d->SwimLaneDef;
my $slcount = $sldef->Swimlanes->Count;
my $sl = $sldef->Swimlanes->GetAt(0);
with a diagram containing 2 swimlanes. While $slcount was actually 2 the return value for the swimlanedef objects $sl was null in both cases.

Report a bug using the link at the bottom of the page.

q.