Sparx Systems Forum
Enterprise Architect => General Board => Topic started by: _Ben_ 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.
-
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.
-
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.
-
You need to do something the line
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 finalselected.Update();
Good luck
q.
-
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.