Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: deefer on August 13, 2010, 07:01:54 pm

Title: element full name in script
Post by: deefer on August 13, 2010, 07:01:54 pm
Hi

is there a way to get the element full name (like in rtf generator) also in a script (VBScript)?

Many thanx
Davide.
Title: Re: element full name in script
Post by: beginner on August 13, 2010, 09:16:27 pm
Parse upward with ParentID.

b.
Title: Re: element full name in script
Post by: deefer on August 13, 2010, 10:17:41 pm
Thanx b.

I was wondering whether there was a ready solution but that's also quite easy.

D.
Title: Re: element full name in script
Post by: Geert Bellekens on August 16, 2010, 03:40:16 pm
Davide,

The solution suggested by b. is the most "correct" one, but if you have to do that a few thousands of times it might be a serious performance issue.
You can achieve more or less the same thing using Repository.SQLQuery.
The advantage is that this is a lot faster (as you only need one call to the db to get all levels iso one call per level).
The downside is that you can't use recursive queries and you'll have to guess the "maximum" levels you will ever need (640 ought to be enough for everybody ;))


Geert
Title: Re: element full name in script
Post by: deefer on August 16, 2010, 03:58:57 pm
Thanx Geert
I'll consider that, but so far I have to perform the command only few times on the whole project so it is ok like it  is...
D.