Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Modesto Vega on March 05, 2016, 01:48:25 am

Title: Class without relationships
Post by: Modesto Vega on March 05, 2016, 01:48:25 am
Is there a way to automatically higlight (change its colour) classes in diagram without relationships to any other classes?
Title: Re: Class without relationships
Post by: Geert Bellekens on March 05, 2016, 02:03:28 am
Not OOTB, but you could of course write a little script to do that.

Geert
Title: Re: Class without relationships
Post by: qwerty on March 05, 2016, 02:28:38 am
Or a query which looks for elements in t_object which have count 0 for their object_id in either end of t_connector.

q.

P.S. Try
Code: [Select]
SELECT * from t_object o WHERE (select count(c.Start_Object_ID) from t_connector c where c.Start_Object_ID = o.Object_ID) = 0 AND (select count(c.End_Object_ID) from t_connector c where c.End_Object_ID = o.Object_ID) = 0You might wish to reduce to certain object types.
Title: Re: Class without relationships
Post by: Modesto Vega on March 10, 2016, 02:21:09 am
Not OOTB, but you could of course write a little script to do that.

Geert
Or a query which looks for elements in t_object which have count 0 for their object_id in either end of t_connector.

q.

P.S. Try
Code: [Select]
SELECT * from t_object o WHERE (select count(c.Start_Object_ID) from t_connector c where c.Start_Object_ID = o.Object_ID) = 0 AND (select count(c.End_Object_ID) from t_connector c where c.End_Object_ID = o.Object_ID) = 0You might wish to reduce to certain object types.
Thanks to both, where can I find an example of how to do this with a script?
Title: Re: Class without relationships
Post by: qwerty on March 10, 2016, 03:07:15 am
Depends on what you want to do with the script. To create a search you can simply create this with the search builder.

q.
Title: Re: Class without relationships
Post by: Geert Bellekens on March 10, 2016, 05:16:31 am
There isn't really a script that does what you need, but I have open sourced all of my scripts here:
https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library (https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library)

Also look at the EAScriptLib MDG technology and the samples provided by Sparx.

Geert
Title: Re: Class without relationships
Post by: Modesto Vega on March 19, 2016, 03:53:30 am
There isn't really a script that does what you need, but I have open sourced all of my scripts here:
https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library (https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library)

Also look at the EAScriptLib MDG technology and the samples provided by Sparx.

Geert
Thanks Geert very useful.