Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: cstiller on March 09, 2005, 07:36:50 am
-
Since this has already cost me wayy too much time, I thought I'd ask here:
I am creating some documentation using the automation interface to EA. We define keywords in the packages (right click on package, package properties). Now I want to access that value form my automation interface.
"package" does not have a property keywords, and I couldn't find any property that contains that value.
I know that each package is also an element. However, "element" does not contain a property keyword either.
I know there is a collection "tagged values". package does not have this. element does. however, the tagged values for the element for the package do not contain the keyword.
TaggedValueEx does not seem to show any different data. It sure does nto show my keywords.
If I look at the properties window in EA, is shows the keyword under "project". This doesn't make any sense to me, but I tried it anyway. package has no "project". Element has no "project". "GetElementProperties" from project works on elements, but does not contain my keyword.
If I export the package to XMI, the keyword shows as a tagged value.
I'm sufficiently furstrated now. How do I access that value? Given that it is on the main property dialog for packages, I assume it should be fairly easy to read it?
Am I doing something wrong? Am I missing something?
-
Hi there,
I just gave it a go and it put the keyword value in t_object.PDATA5 which means you can access it in the Automation Interface from Package.Element.Miscdata(4)
Hope this helps
Neil
-
Thanks a lot, this works!
I have to ask though: What did you do to find out about this? I don't see how I was supposed to ever find this, especially given that "miscdata" seems to be a collection of some sorts, but can't be accessed using "count" and "getat". Is there a mapping of the different miscdata "fields" to the fields form the EA UI?
-
What did you do to find out about this? I don't see how I was supposed to ever find this
If you get stuck you can either open the .EAP file in MS Access and browse around until you find whereabouts in your database the information has been put, or you can ask Sparx support 8).
especially given that "miscdata" seems to be a collection of some sorts, but can't be accessed using "count" and "getat". Is there a mapping of the different miscdata "fields" to the fields form the EA UI?
No it's not a collection, it's 5 separate fields. In the database they are called 'PDATA1' to 'PDATA5'; in the AutInt they are callled 'Miscdata(0)' to 'Miscdata(4)'. Try a search for "Miscdata" in the EA help file for more info.
HTH,
Neil
-
These database fields are not documented
Hmm, useful !!
-
Yes indeed, Mike :(
Now I wonder how to gain access to the Keywords of a class from the automation interface. Maybe I overlooked it, but I couldn't find any hint in the docu. Can anyone help?
-
Maybe it's Element.Tag. ;)
--
t-kouno
-
I remember something about this from before.
It was some time ago, and I think the bottom line was that keywords could not be written via the automation interface. [Of course you could read the database field directly, but that's not what I'm talking about.]
I don't remember whether I found anything about this in the forum, but take a look at the MiscData property of the Element class in the Automation Reference section of the user guide.
You'll note that this property (array) is read-only.
Of course I needed to write this, and at the time EA opened Access files with an exclusive lock, so I switched to a repository and wrote a separate channel to the database. Sparx probably wants to keep this carefully guarded until the next global revision of the schema, so we may have to live with this limitation for some time.
David
-
Maybe it's Element.Tag. ;)
--
t-kouno
I'll give it a try and will report the result. Tomorrow is a holiday in Germany :)
Edit: Thanks, Takeshi! The keywords are actually found at the Tag property. :)
(EAUI :-X)