Author Topic: Same Size Elements Between Diagrams EA 9  (Read 914 times)

_Ben_

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Same Size Elements Between Diagrams EA 9
« on: December 08, 2012, 03:45:07 am »
Hi,

Hoping someone can help me with an incredibly frustrating problem. I'd like to ensure that elements between two diagrams are equally sized - how is this achieved in EA 9?

Alternatively, is it possible to get/set an element in pixels?

Thanks,
Ben.

qwerty

  • EA Guru
  • *****
  • Posts: 9575
  • Karma: +167/-148
  • I'm no guru at all
    • View Profile
Re: Same Size Elements Between Diagrams EA 9
« Reply #1 on: December 08, 2012, 04:49:25 am »
AFAIK you can't do that out of the box. One solution is to write a script that loads the pixels size of the selected element and a second to apply the stored size.

Also you might ask for a new feature (Suggestions board as well as the official way).

q.

_Ben_

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: Same Size Elements Between Diagrams EA 9
« Reply #2 on: December 08, 2012, 07:39:54 am »
Thanks for the response, shame that it's not possible. I'm newish to EA so will check out the online resources re scripting.

Thanks,
Ben.

qwerty

  • EA Guru
  • *****
  • Posts: 9575
  • Karma: +167/-148
  • I'm no guru at all
    • View Profile
Re: Same Size Elements Between Diagrams EA 9
« Reply #3 on: December 08, 2012, 08:43:50 pm »
You need to do something the line
Code: [Select]
dia = Repository.GetCurrentDiagram(); // get open diagram
diaObjects = dia.SelectedObjects() // collection of sel. objects on dia
// foo to assert only one is selected
selected = diaObjects.whatEverToGetTheFirstObject(); // language dependend
width = selected.right - selected.left;
height = selected.top - selected.bottom;
to get the size. Additional foo to save the size in Windoze's guts is up to you.

Setting the size is similar. You'd need to modify either .right and .bottom. And a final
Code: [Select]
selected.Update();
Good luck

q.

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6410
  • Karma: +54/-6
    • View Profile
Re: Same Size Elements Between Diagrams EA 9
« Reply #4 on: December 10, 2012, 08:43:09 am »
I don't think it's a particularly common problem.

That status bar on the bottom of the EA window will (optionally) show the size of the selected element. You can then manually modify one to match by using the Ctrl+Arrow key shortcut for precise resizing.

Another approach would be to copy one element temporarily onto the other diagram. Select any elements you want the same size and then use the 'Same Height and Width' command.
« Last Edit: December 10, 2012, 08:45:02 am by simonm »
Simon

support@sparxsystems.com