Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Csaba Koszegi on February 17, 2015, 07:14:55 pm

Title: Create instances with connectors
Post by: Csaba Koszegi on February 17, 2015, 07:14:55 pm
Hi,
I would like to create instances from a set of elements situated in different packages, so that the resulting instances have the same relationships as their classifiers.

1. "Copy connectors" is effectiv only for elements dropped together from the project browser on a diagram, but multiple selection in project browser is possible only for elements in the same package.

2. Gathering the needed elements on a diagram, making here a multiple selection and dropping them on another diagram like instances does not work because only elements of the same type and stereotype are accepted in one operation.

Does anybody know other solution?

Thanks:
Csaba K[ch337]szegi

Title: Re: Create instances with connectors
Post by: Geert Bellekens on February 17, 2015, 08:41:56 pm
You could write a small script or addin to do that for you.

Geert
Title: Re: Create instances with connectors
Post by: qwerty on February 17, 2015, 08:45:17 pm
You need to select the classifiers in the browser. Then (ctrl-) drag them over a diagram where you want to see the instances. The ctrl is needed if you made changes to the drop-to-diagram dialog before and does not hurt in the other case. Now select "for all", "copy connectors" and "as instance". That will create the instances in the folder where the diagram is located.

You could do the same using the API if you need some sort of automated selection of classifiers for a larger count.

q,
Title: Re: Create instances with connectors
Post by: Csaba Koszegi on February 17, 2015, 11:30:20 pm
@qwerty
 - "... select the classifiers in the browser" - how to do it, if they are not in the same package?
Title: Re: Create instances with connectors
Post by: qwerty on February 18, 2015, 12:04:06 am
By ctrl-clicking them. I confess, this can be tedious. You might create a Model View that finds the relevant classes or you can use the search results (in which case you need to make the search results floating or docked somewhere else).

q.

P.S. I just noticed that in V12 dragging from the search view does not show the "As Instance" dialog for the 2nd dropped element.

P.P.S: V11 the same, so I guess this is "normal" EAUI
Title: Re: Create instances with connectors
Post by: Csaba Koszegi on February 18, 2015, 12:49:03 am
Try ctrl-click, please, for some elements in different packages! Only the last ctrl-clicked element remains selected at me. I use V11.
Title: Re: Create instances with connectors
Post by: qwerty on February 18, 2015, 02:20:31 am
OMG - EAUI :-[

So your last resorts are a) doing it one by one or b) write a script.

q.