Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Amy_N on June 18, 2016, 06:49:48 pm

Title: Diagram Patterns in MDG
Post by: Amy_N on June 18, 2016, 06:49:48 pm
Hi. I have included some diagram patterns in my MDG that appear in various toolboxes. I have developed the MDG in a separate model and then added the MDG to our company model (server based).

Some of these patterns include elements that I would like to use an alternative image for. I have noticed when I do this for an MDG that is developed within the model it will be deployed in it all works fine. However when I do this for my MDG that has been developed in a separate model the diagram pattern works but it displays as the default image.

I have tried both importing the image with the MDG and having an image with the same name in the main model. I know I could use a shape script. However the image is a logo and the resolution is poor when I use an emf or jpeg version (but very clear when using the PNG version directly through 'alternate image).

It's actually for a diagram title bar that I would like users to be able to drag onto their diagrams. If there was a way to display this on all diagrams in the model as a default that would actually be a better solution but I couldn't find this option anywhere.
Title: Re: Diagram Patterns in MDG
Post by: Geert Bellekens on June 18, 2016, 08:00:51 pm
Hi Amy,

Not long ago I had a similar request from a customer.
He wanted a default title bar with image and diagram info.

What I did was create a small vbscript that looks for the template diagram and finds the diagram of the same type.
It then copies everything that is on the template diagram to this diagram;

So now my client can create different templates for different types of diagrams.
You can find the script here: Add defaults from template diagram (https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/blob/master/Projects/Project%20M/Diagram%20Group/Add%20defaults%20from%20template%20diagram.vbs)

If you install EA-Matic (https://bellekens.com/ea-matic/) you could even make this script run automatically after creating a new diagram.

Geert
Title: Re: Diagram Patterns in MDG
Post by: Amy_N on June 18, 2016, 11:46:09 pm
Thanks Geert will check that out!  :)