Sparx Systems Forum
Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: duncan.greenyer on March 31, 2023, 09:09:43 pm
-
I'm extending Archimate using a profile when I add a shapescript the ArchiMate Actor icon is still being drawn how do I override this?
-
I guess you'll have to redefine the decorations as well in your shapescript. See https://github.com/GeertBellekens/Enterprise-Architect-Shapescript-Library/tree/master/Archimate3 (https://github.com/GeertBellekens/Enterprise-Architect-Shapescript-Library/tree/master/Archimate3) for the original Archimate shapescript.
Geert
-
Its strange but redefining the decoration does not seem to prevent the original decoration from being rendered. This means I can still see the original decoration underneath.
-
IIRC, Paolo dealt with a similar issue and he plastered the original icon with some rectangle (though the color at the border won't match exactly due to the gradient of the base color).
q.
-
IIRC, Paolo dealt with a similar issue, and he plastered the original icon with some rectangle (though the color at the border won't match exactly due to the gradient of the base color).
q.
As q says, we had to turn off gradient fill otherwise, it looked "wrong". Some might say "gradient fill" is an affectation, and we really haven't missed it.
Paolo
-
The problem is, if you use decoration to add a rectangle over the icon the decoration is 16x16 and the ArchiMate icons are larger and therefore are not completely covered. I have opted to create a new decoration icon with NW orientation so that both are displayed. Since its a specialization of ArchiMate it shouldn't matter butI hope one day we can dump shape script and move to SVG for better control.
-
I doubt that SVG would be an alternative since you can not script it.
q.
-
The problem is, if you use decoration to add a rectangle over the icon the decoration is 16x16, and the ArchiMate icons are larger and therefore are not completely covered. I have opted to create a new decoration icon with NW orientation so that both are displayed. Since it's a specialization of ArchiMate, it shouldn't matter but I hope one day we can dump the shape script and move to SVG for better control.
Just keep increasing the size until the underlying decoration is covered. From memory, we've gone as high as 120x115.
Paolo
-
Cannot script SVG? I assume you mean there is not exposed object model in EA? Obviously SVG by its very nature is scriptable. You take the SVG parse it into an object model which then gives you the ability to call methods on those objects, the same way you can script SVG in a browser, just add the script to the SVG event.
-
Cannot script SVG? I assume you mean there is not exposed object model in EA? Obviously SVG by its very nature is scriptable. You take the SVG parse it into an object model which then gives you the ability to call methods on those objects, the same way you can script SVG in a browser, just add the script to the SVG event.
How would you include "if x then render A else render B" in an XML structure?
q.
-
I would use the same technique as in a browser:
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
<script>//<![CDATA[
…code…
//]]>
</script>
</svg>
-
Oh! I was not aware of that. Probably means you have to code some Java-like stuff?
q.
-
Well it would be Javascript but the level of control would far exceed ShapeScript as we could not only have If then else but loops etc... or event make other calls when elements are about to be rendered
-
Yes, probably. But then you would stumble over the performance issue in quite some cases. Which is why shape script is so primitive. Anyway, unless we all are supplied with enough Q-bits there will likely be no progress in that direction.
q.
-
I don't think its going to take quantum computing just a better Javascript engine like V8.