Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Boron on October 09, 2018, 06:35:43 pm
-
Hello,
is it possible to create an MDG from an EA Script?
Assuming I have already several xml files containing my UML profile, my own toolbox, my own diagram type, etc.
And, most important, I have already a correct and complete *.mts file.
I would now like to create the MDG.xml file running a script, instead of clicking through the dialog window.
Is that possible?
So far I have not found any information on that in the reference of the automation interface.
-
I don't think there is any support for it in the API, but it it is not rocket science either.
If you wanted to do it yourself you would basically need to put the different sources into a big XML file.
Geert
-
What's even better with assembling the MDG from XMLs yourself is that you can look into the latter and detect whether they contain what they should (so is it a profile, for toolboxes, patterns, etc.). EA does not do that but blindly copies the files you pointed it to. I can't count how often I saved a profile at the wrong place (since EA does not remember the preferred place to save) which led to a just not working MDG ("go, figure" EA lets me stand in the rain) - well, until I did the assembly myself.
q.
-
What's even better with assembling the MDG from XMLs yourself is that you can look into the latter and detect whether they contain what they should (so is it a profile, for toolboxes, patterns, etc.). EA does not do that but blindly copies the files you pointed it to. I can't count how often I saved a profile at the wrong place (since EA does not remember the preferred place to save) which led to a just not working MDG ("go, figure" EA lets me stand in the rain) - well, until I did the assembly myself.
q.
Version 14.1 now remembers where you last save the package/diagram as a profile thus avoiding these common mistakes.
You see sometimes they listen to us :)
Geert
-
I can't remember when I first asked for that. At least 5 years ago. At least!
q.
-
Thanks guys.
If it is really that easy, not all my faith in mankind is lost :).
-
SavePackageAsUMLProfile, SaveDiagramAsUMLProfile and GenerateMDGTechnology were added to the Repository class in EA 14 to help with building Profiles and Technologies via script.
https://sparxsystems.com/enterprise_architect_user_guide/14.0/automation/repository3.html
-
SavePackageAsUMLProfile, SaveDiagramAsUMLProfile and GenerateMDGTechnology were added to the Repository class in EA 14 to help with building Profiles and Technologies via script.
https://sparxsystems.com/enterprise_architect_user_guide/14.0/automation/repository3.html
Yes!
In fact I saw that and then promptly forgot about it :-[
Geert