Book a Demo

Author Topic: Set diagram page orientation with script  (Read 5389 times)

MatthiasVDE

  • EA User
  • **
  • Posts: 196
  • Karma: +1/-0
    • View Profile
Set diagram page orientation with script
« 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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Set diagram page orientation with script
« Reply #1 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.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Set diagram page orientation with script
« Reply #2 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

Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

MatthiasVDE

  • EA User
  • **
  • Posts: 196
  • Karma: +1/-0
    • View Profile
Re: Set diagram page orientation with script
« Reply #3 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?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Set diagram page orientation with script
« Reply #4 on: May 11, 2017, 05:48:10 pm »
I also tried with V12. So a fixed bug? Where's the champagne?

q.