Does anyone know if there is a way to change the icon of a part in a diagram via scripting?
//Mattias
Mattias,
I assume with "change the icon" you mean that you want to set an arbitrary own icon to the element, or rather change it as medini does it for Controller, Hardware, Software etc.?First option is not possible, for second you simply have to change the "typeCode" attribute like:
selection[0].typeCode = "Component";
Jan
No, I meant the first, changing it like you can do from the right-click menu. Ok, I suspected that it might be impossible/hard. But I see some traces of the the icon image in eAnnotations -> contents -> imageBuffer, but to try to change that would be very hacky.
Thanks anyway,
Mattias
Ah, I got that wrong, you are referring to the icon / image on the diagram, right? I thought you mean the browser icon.
Well, in theory that's possible though hard as you say. I will double check to be sure.
Ah, promising. :-)
I found some traces that you are using Eclipse GMF for the diagrams, right? To do it you would have to use some undocumented function calls, I assume.
What do I need it for? Well, I'm trying to use the FMEA-MSR import function to import an architecture made in Enterprise Architect and I would like to display the block diagram from an image. I know that there is an EA import function already, but it is not doing what I want and I would rather use FMEA-MSR instead since it is also useable in other FMEA tools.
Regards,
Hi Matthias, a quick check confirmed that this is very much too complicated, so impossible for time being, I'm sorry.
That was a midair collision. Well, yes we use GMF and the image is saved as an additional style, however, the function to perform that nicely and transactional assumes that the editor is open and GMF edit parts are created and exist, it cant work directly on the View diagram model. There is one more chance I need to check to expose something but may take a while.