Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: «Midnight» on January 30, 2006, 04:55:26 am

Title: Boundaries and contained elements
Post by: «Midnight» on January 30, 2006, 04:55:26 am
Anyone have insights on how to handle - thorough the automation interface - the relationship between a boundary (the enclosure, not the UP Boundary Element) and those elements it encloses.

I'm looking to do things like:


It's easy to identify or add a boundary, but from there I'm lost.

David
Title: Re: Boundaries and contained elements
Post by: KP on January 30, 2006, 02:03:11 pm
Quote
I'm looking to do things like:
  • add a boundary to a diagram, then add elements to the boundary
  • query a boundary to enumerate the elements it encloses
  • create a hierarchy of nested boundaries

It's easy to identify or add a boundary, but from there I'm lost.


I think you'll need to loop through all of the diagram objects on a diagram and calculate (from the left, right, top and bottom attributes) whether it is fully contained within the boundary.
Title: Re: Boundaries and contained elements
Post by: «Midnight» on January 30, 2006, 02:48:12 pm
Thanks KP,

I was getting resigned to that fate...

Of course boundaries are arbitrary (or whatever) partitionings of a system, so there is really much less of an 'ownership' relation between them and their enclosed elements than in other UML constructs.

I gather I can just line up the elements I want to enclose, calculate the greatest extent of height or width, and then simply plunk down a boundary and size it accordingly.

The other way would sort of be in reverse, as you suggest.