Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: MatthiasVDE on May 10, 2017, 10:58:11 pm

Title: Set diagram page orientation with script
Post by: MatthiasVDE on May 10, 2017, 10:58:11 pm
The following code creates a class diagram under the BIGroup element, this part works. But when I try to set the orientation of that class diagriam to landscape, it seems not working. When I debug it by showing a message box with the orientation, he gives me an 'L'.
Code: [Select]
function EA_OnPostNewElement(Info)
    dim elementID
    elementID = Info.Get("ElementID")
dim BIGroup
set BIGroup = Repository.GetElementByID(elementID)
dim classDiagram 'as EA.Diagram
set classDiagram = BIGroup.Diagrams.AddNew("LDM-BI Entities Overview", "Class")
classDiagram.Orientation = "L"
classDiagram.Update()
BIGroup.Diagrams.Refresh()
end function
Title: Re: Set diagram page orientation with script
Post by: qwerty on May 11, 2017, 01:22:39 am
I guess this is a buried bug. You can change the letter and it's saved, but it does not change the property (it's alway Portrait).

q.
Title: Re: Set diagram page orientation with script
Post by: Helmut Ortmann on May 11, 2017, 02:24:40 pm
Hi,

yesterday I tried it with C# and EA 13 to change the diagram page orientation from P to L and vice versa.

It worked.

Kind regards,

Helmut

Title: Re: Set diagram page orientation with script
Post by: MatthiasVDE on May 11, 2017, 05:02:25 pm
Hi,

yesterday I tried it with C# and EA 13 to change the diagram page orientation from P to L and vice versa.

It worked.

Kind regards,

Helmut

I'm working with 12.1, maybe that's the reason?
Title: Re: Set diagram page orientation with script
Post by: qwerty on May 11, 2017, 05:48:10 pm
I also tried with V12. So a fixed bug? Where's the champagne?

q.