Author Topic: Set default image from image asset  (Read 6133 times)

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Set default image from image asset
« on: December 10, 2020, 01:28:22 am »
We are experimenting with the new Azure icons.

We would like to use them on our ArchiMate elements.
The idea is to have a set of elements in our library that represent the azure services and components we use.

On a diagram I can use Appearance | Select an Image Asset to and then select the «Image» element from the standard Azure icons library.

The problem with this approach is that this image is local to the diagram.
When I use the element on other diagrams, the element diagram isn't shown.

This works with Appearance | Select a Default Image but that only lets met select an image from the image manager.

And I see no easy way to get the images from the Azure library into the image manager. The only way I see is save each image to a file, and then import that into the image manager.

Does anyone see an easy way to solve that problem?
I'm willing to write a script to automate it, but I was hoping that either wouldn't be necessary, or that it wouldn't take days to write.

Geert

RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Set default image from image asset
« Reply #1 on: December 10, 2020, 11:48:59 am »
Could you use a Template Package?
Best Regards, Roy

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Set default image from image asset
« Reply #2 on: December 10, 2020, 04:02:07 pm »
Could you use a Template Package?
How is the project template package going to help?

I want to set a default image for individual elements, not for all new elements of that stereotype.

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13387
  • Karma: +566/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Set default image from image asset
« Reply #3 on: December 10, 2020, 06:59:59 pm »
Damn,

I thought I had it. Looking in the database I found that the image asset elements had the image in the t_document.Bincontent column.
The image manager images are stored in t_image.image

I need those image in the image manager in order to use them as the default image, so I thought I could just copy them over.

I tried that with this query for a single example
Code: [Select]
insert into t_image (ImageID, Name, Type, Image)
select o.Object_ID, 'Azure_' + dc.DocName as Name, 'Bitmap',  dc.BinContent
from t_object o
inner join t_document dc on dc.ElementID = o.ea_guid
where o.Stereotype = 'Image'
and o.Object_ID = 499979
That seemed to work fine, and the record actually showed up in the image manager, but unfortunately I got an error when selecting it:

Quote
---------------------------
Enterprise Architect
---------------------------
Not a supported image file
---------------------------
[ OK ]
---------------------------

So I did a little manual test. Exported the image from the «image» asset to a .png file, and then imported that image into the image manager.
Then I compared the bincontent from the image manager to the bincontent the image asset. The bincontents were different :'(

So apparently EA uses a different format for image assets then it uses for the image manager; sigh....

Back to square one...

Anyone have a bright idea on how to solve this?

Thanks

Geert


RoyC

  • EA Administrator
  • EA Practitioner
  • *****
  • Posts: 1297
  • Karma: +21/-4
  • Read The Help!
    • View Profile
Re: Set default image from image asset
« Reply #4 on: December 11, 2020, 10:02:21 am »
Sorry, I read this line in your post:

The idea is to have a set of elements in our library that represent the azure services and components we use.

And I thought you wanted a constant group of elements to work from.
Best Regards, Roy

YogaMatt

  • EA User
  • **
  • Posts: 111
  • Karma: +8/-0
    • View Profile
Re: Set default image from image asset
« Reply #5 on: April 26, 2023, 04:38:23 am »
Back to square one...
Hi Geert
I've the same need - and to do with Azure icon set, no less. Did you solve it?
Namaste,
Yoga Matt

BobM

  • EA User
  • **
  • Posts: 144
  • Karma: +9/-0
    • View Profile
Re: Set default image from image asset
« Reply #6 on: May 02, 2023, 04:32:05 pm »
I once contacted support about this
The image library downloadable from the sparx website should have the azure icons:

Quote
Hello BobM,
Thanks for contacting Sparx support.
We understand want to add your own images to the navigation cell.

You can add images using the 'Add new' option available on the Image Manager.
Please check the following link for more details...
https://sparxsystems.com/enterprise_architect_user_guide/16.0/modeling_fundamentals/bitmapimagesindiagrams.html
You can also import the bundled clip art collection of UML-based images as an Image Library file downloaded from the Sparx Systems website in the link provided below...
https://sparxsystems.com/enterprise_architect_user_guide/16.0/modeling_fundamentals/importimagelibary.html

Custom icon/images cannot be added to the navigation cell, instead you can change the image using the 'select a default image' option available under the appearance icon which is displayed when the navigation cell is selected.

rtmoose73

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Set default image from image asset
« Reply #7 on: November 17, 2023, 10:56:35 am »
Geert & BobM,

Thank you both for having brought this issue to the fore. However, have either of you found a solution? This seems like a pretty basic need for most users. Unless the 3 of us are using EA in some non-standard way. Hopefully there is an answer out there.

Besides this specific issue, I have a related question that I hope someone can provide some clarity on and I hope each of you will allow me to discuss.
Why are there so many different ways in which iconography/glyph/graphic notation is associated and subsequently managed within the EA software and specific models?
The use case surrounding the inclusion of MS Azure graphics is a good example of the needless complexity and the problem.
Why are the cloud service graphics made available as an "image pattern" and added to the model through "the wizard"?
Why not provide them in the Image Manager library, along with any/all other custom or alternate images?

The following is my "stream of consciousness" and will probably flaunt my lack of real understanding of how EA is used or functions. So please be kind and help me and others learn if you know otherwise. Thank you.

In general, the iconography/glyph/graphic notation management is one of the areas of Sparx EA that makes the least amount of sense to me. The process how it exists now is very cumbersome and defeats the point having a tool like EA. My models which include Azure/AWS/etc services (which most have one or more CSP integration) must have large resource packages just so I can have recognizable graphics. When I initially started working on our Azure hosted systems, the first way I tried to change the graphics was through Image Manager. And based on the lack of Azure graphics, I started to make my own; that is until I discovered the aforementioned patterns.

I am not sure why there are so many different ways in which graphics can be associated with model elements as well as how they are applied and managed. It seems to me this must be a function of an organically evolved system. Which is where architecture can help in maintaining a consistency in the adoption of new functions with the continuous improvement of existing. I look at this as a conflict between EA as a tool for producing "functional engineering models/diagrams" and ease of consumption/understanding of that content by a wider audience. The current image manager is an odd mini-tool that provides little utility and is cumbersome in its execution. The images it contains by default are an odd mish-mash of graphics and the content uses none of the extended meta-data like title or description. And BTW, none of them are taggable to help in isolating the options down to the graphics related to the element I am working with. 

My proposal for a future version (unless it already exists)
Each element/object should have a "function tag", by default all element/object have a graphical representation based on their specification or standard and that graphic is linked to that element/object by a shared "function tag" as default. All graphic content not tied to a recognized engineering specification (like the Cloud graphics) can also be given one or more "function tags". Then in Image Manager, all graphic representations are listed and can be sorted by various attributes like the "function tag". When you need to change the look of an element, you would select "appearance" which would open the Image Manager. You can then see all the graphics tagged with the same function from across all standards or collections. You could then select the one you want and set it as default for the element, diagram or model. All other aspects of the element stay the same, only the image changes. This "function tag" is not the same as the stereotype, it would only affect the graphical appearance.
With this, there are no more resource packages and changing the look of an element is easy. Additionally, if you select the diagram, you should be able to replace all element graphics with the graphics from a different collection with just a few clicks.

Thank you all for your time and engagement.

Tony