Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: André Olivera on April 22, 2011, 02:51:41 am
-
Hi!
Does someone know a way to do an "Make Composite" action in one element?
I found a property of Element ("CompositeDiagram") but it is to get the composite diagram if the element is composite.
I want to know how to turn the element composite, and create this diagram.
Thanks!
-
André,
There's a whole lot of posts about how to make an element composite on this forum. A search for "composite" should already reveal most posts.
I remember it includes some messing about in the database as this function was not exposed by the API.
IIRC they added that in v9.
Geert
-
An IsComposite attribute has been added to the EA.Element class in Enterprise Architect 9. To set an element as composite, simply set IsComposite = True.
For more information on the EA 9 beta, please see:
http://www.sparxsystems.com/products/betas.html
HTH.
-
Thanks Geert and Aaron..
Geert:
I found two topics interestings for me in the search:
With this: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1301601786
I understand that I can put a diagram inside the element and after click in the button "create composite" and it will work.
And this: http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1302080632
is more similar with what I want to do, but I didnt test yet if works. According the topic I have to create a diagram with the type "CompositeStructure" inside the element.
Aaron:
I think that this solution (create a diagram inside the element) wont turn the element composite. For me it is not a big problem I think. I think that with this attribute it will work fine.
For now I cannot change my version of EA. But I will try make this after.
Thanks a lot!
André.
-
I tested..
I created a diagram with type "CompositeStructure".
The element didnt change to composite then Im not able to go to the diagram with double-click.
I turn the element into comsposite (Advanced -> Make Composite) then the created diagram is accessed by double-click.
Im almost sure that in version 9, if I change this property by code I can access with double-click.
-
The topic I was referring to was this one:
http://www.sparxsystems.com/cgi-bin/yabb/YaBB.cgi?num=1217982429/0
this explains how to make an element composite using the API in EA 8.
I haven't tested the functionality in v9 yet.
Geert
-
Great!
According the topic I can change some fields in the database (.EAP) to turn the element composite.
I will try to use the method "Repository.SQLQuery (string SQL)" to do this.
I dont know why my search didnt return this topic. Now I am having a lot of problems with the search in the forum.
Thanks a lot!
-
André,
Repository.SQLQuery won't work if you are trying to update something.
You'll have to use Repository.Execute(SQLString). (undocumented backdoor operation :o)
Geert
-
hehe great..
I read this in the other topic but I thought that they were talking about this function (SQLQuer())..
really crazy this function without anyone documentation.. but is ok!
thank you!