Book a Demo

Author Topic: Scale diagram to 1 page API?  (Read 5572 times)

Hurra

  • EA User
  • **
  • Posts: 184
  • Karma: +0/-0
    • View Profile
    • Find me at LinkedIn!
Scale diagram to 1 page API?
« on: June 09, 2017, 05:46:35 pm »
Hello!

I made a small script to export a diagram as PDF. I know there is a setting in Diagram Properties > Diagram > Page Setup > Advanced > Scaled Printing: Scale to 1 Page which I use for larger diagrams.

I did some googling but didn't found any functions for this in the API. Is there? Or how can I change this setting with script, or make this setting default for a model/project?

Thank you!
always learning!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Scale diagram to 1 page API?
« Reply #1 on: June 09, 2017, 07:28:09 pm »
t_diagram.PDATA has an entry ScalePI=<n>;  where <n> is 0 or 1 (scale to 1 page). Out of my head I can't recall the mapping to the API for t_diagram.PDATA (probably there is none). If so, you need to use Repository.Execute.

q.

Hurra

  • EA User
  • **
  • Posts: 184
  • Karma: +0/-0
    • View Profile
    • Find me at LinkedIn!
Re: Scale diagram to 1 page API?
« Reply #2 on: June 09, 2017, 11:10:57 pm »
Thank you qwerty, I will give it a try!
always learning!

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Scale diagram to 1 page API?
« Reply #3 on: June 10, 2017, 12:45:01 am »
P.S. ExtendedStyle is the API attribute to map PDATA (just looked into my own book).

q.

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Scale diagram to 1 page API?
« Reply #4 on: June 16, 2017, 05:21:09 am »
Hi,

with the open source hoTools you can change Style/Appearances/Compartments for:
- Diagrams
- Nodes on Diagrams
- Connectors
See WiKi:
https://github.com/Helmut-Ortmann/EnterpriseArchitect_hoTools/wiki/DiagramGeneralStyles

You can configure your styles in Settings.json and apply it by Click to:
- Selected Package, Element, Diagram, Diagram-Elements + Connector
- Recursive from the selected package

Scaling a diagram to one page works for me with: "PPgs.cx=1, PPgs.cy=1, ScalePI=1"
See:
https://github.com/Helmut-Ortmann/EnterpriseArchitect_hoTools/wiki/DiagramStyles#Example

The WiKi also shows a lot of possible configurations you can set by Script/Addin or hoTools.

Kind regards,

Helmut

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