Book a Demo

Author Topic: Automatic layout of a part with ports  (Read 5779 times)

Dave.B

  • EA User
  • **
  • Posts: 94
  • Karma: +0/-0
    • View Profile
Automatic layout of a part with ports
« on: December 01, 2009, 08:24:32 am »
I'm working with SysML IBD models and have now reached the stage where I need to build a refined model that uses ports at the source and sink ends of my inter-part connectors.

EA is driving me nuts! >:(

I have created blocks with ports on them. Fine. I can add a block to a new diagram and when I do so (by dragging it from the project browser) EA prompts as to whether I want the embedded elements adding and even from which diagram it should clone the layout. Net result is a perfect copy of that block with its ports based on the supplied base diagram. Great! But not of much benefit since a simply copy-past of the block selected with its ports produces the same result.

However....  :-[
If I create a part and use one of the aforementioned blocks as its type then EA creates the part devoid of its block's ports. OK, so now using the embedded elements context menu we can add those ports by selecting the "inherit" tick box item and then select all and close. But what a mess! EA simply piles the inherited ports on to the part with no regard for layout. Moreover, having manually laid out the ports on a part of a given block type, creating another part with the same type simply puts me back to the start of laying it out all over again!!!

Is there no way to set a default layout for a prototypical part instance of a block, i.e. so that it follows the block's original layout?

I have noticed that if I size the part to be the same size as its classifying block, that sometimes EA will partially layout the ports following the block's layout. But I haven't seen it yet do it properly and completely, so I'm still left to shift them into place. And I haven't yet figured out what the influencing factors are.

Any ideas?

Thanks in advance.

Regards
Dave B.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Automatic layout of a part with ports
« Reply #1 on: December 01, 2009, 08:34:20 am »
If you drop from the project browser as an instance (hold ctrl if you don't get the option) you will still have the option of copying an existing layout.

Dave.B

  • EA User
  • **
  • Posts: 94
  • Karma: +0/-0
    • View Profile
Re: Automatic layout of a part with ports
« Reply #2 on: December 01, 2009, 10:15:07 pm »
Simon,
What you suggest only works when drag and dropping SysML blocks with embedded elements onto a diagram canvas. It does not work for drag and dropping existing parts onto a new diagram with the composite block as the back-drop.

The only way of adding an existing part with its embedded ports onto a new diagram is to select it and its ports in an existing IBD diagram and copy-paste it onto the new one. I haven't found a way of creating a new part from an existing block and having the part's size/shape and its ports laid out based on another part instance of that block or the block's representation on a BDD.

Regards
Dave B.

PS Using EA 7.5.849.
« Last Edit: December 01, 2009, 10:19:40 pm by Dave.B »

Dave.B

  • EA User
  • **
  • Posts: 94
  • Karma: +0/-0
    • View Profile
Re: Automatic layout of a part with ports
« Reply #3 on: December 01, 2009, 10:43:17 pm »
I've just had a further play with this problem and it seems to me that the route cause of it is that the position of the ports on a block have an absolute diagram coordinate!

I've come to this conclusion by creating a new part from an existing block. Then copy-paste that block onto the same diagram (on the diagram canvas and not onto the composite block) and then select the new part and it, and then make both the same size - the part is now the same size/shape as its classifier. Then with this diagram and the block's original diagram set to the same scale (i.e. 100%) the part can be positioned relative to its block by flicking back and forth between the diagrams. I then add the ports with the embedded elements tool as described in my original email.

What I observe is this:
  • when the part is positioned above and to the left of the block the ports are added in pile on its bottom right corner.
  • when it is positioned below it and to to the right, the ports are added in a pile on its top left corner.
  • when the part and the block are in about the same absolute position on the two diagrams some of the ports are placed in the right place, but some end up in a piles on any of the corners or even along the top and bottom edges. (The block has them on the left and right edges only.)
So it seems that may be the embedded elements tool is trying to do the right thing but fails because the default size for a part does not match the classifers size/shape, and even when this is fixed the use of absolute coordinates for the ports makes it just about impossible for it to work properly.

Any thoughts anyone?

Regards
Dave B.
« Last Edit: December 01, 2009, 10:46:18 pm by Dave.B »

Dave.B

  • EA User
  • **
  • Posts: 94
  • Karma: +0/-0
    • View Profile
Re: Automatic layout of a part with ports
« Reply #4 on: December 02, 2009, 10:00:37 am »
I've now realised that when I copy paste an element on one diagram onto another one that it is placed on the target diagram at the same position. So... by sizing the new part instance to be the same size as its classifying block and then by aligning its top and left edges with the pasted block that I get it to be at exactly the same diagram coordinates. I then delete from the diagram the pasted block, select the part and add the inherited/owned ports to it.

Guess what? All the ports are added in their correct positions!!  ;D But what a kurfufle!  >:(

So its a work around, but please can we get composite digram modelling, which is essential to SysML modelling, to work nicely. Please.

Regards
Dave B.