Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: adepreter on February 01, 2024, 01:37:59 am

Title: Element Types/Stereotypes & their properties/TVs for the active language
Post by: adepreter on February 01, 2024, 01:37:59 am
Hello,

How could I get the list of element types/stereotypes and their properties/tagged values for the active language?

Thank you in advance,
Alain
Title: Re: Element Types/Stereotypes & their properties/TVs for the active language
Post by: Geert Bellekens on February 01, 2024, 02:35:25 am
You can't, unless you parse the MDG file.
And the MDG file can be binary encoded, stored locally or on an url, or stored in the database.

The local or url files, are pretty doable, but I haven't found a way to read an MDG stored in the database, or in an encoded binary file.

Geert
Title: Re: Element Types/Stereotypes & their properties/TVs for the active language
Post by: adepreter on February 01, 2024, 04:12:16 am
Thank you Geert  :)

So the trick would be to
- Get the ID of the active MDG. Maybe by getting the prefix of the active diagram... (if any)
- Identify the path/url of the active MDG file (need to figure out in the case where it is not in Program Files)
- Load and parse the xml file

Would that make sense?
Title: Re: Element Types/Stereotypes & their properties/TVs for the active language
Post by: Geert Bellekens on February 01, 2024, 07:06:04 am
Thank you Geert  :)

So the trick would be to
- Get the ID of the active MDG. Maybe by getting the prefix of the active diagram... (if any)
- Identify the path/url of the active MDG file (need to figure out in the case where it is not in Program Files)
- Load and parse the xml file

Would that make sense?
Yes, but that would only work for the few cases where the MDG is loaded from an actual XML file.
As indicated, you can also load MDG file in the database, and some MDG are loaded from the InternalTechnologies folder. (C:\Program Files (x86)\Sparx Systems\EA\InternalTechnologies)
Although these files have a .xml extension, they are in fact binary files.

To me it looks like you are chasing rainbows here. Whatever solution you end up with, will have cost lots of effort, for very little benefit.

Geert