Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: Ceronimo on June 07, 2016, 12:40:27 am

Title: Create Custom Picture for a Class Element
Post by: Ceronimo on June 07, 2016, 12:40:27 am
Hi is it Possible to create a ShapeScript which Looks just like a Class with a puzzlepiece in the right upper Corner.
Im only able to make the full Picture (class) representing the puzzle Piece i have designed .

Thank you for your help.
Title: Re: Create Custom Picture for a Class Element
Post by: qwerty on June 07, 2016, 01:15:08 am
Sure. Just add it as Decoration with orientation="NE"

q.
Title: Re: Create Custom Picture for a Class Element
Post by: Ceronimo on June 07, 2016, 03:26:22 pm
Yes it works with decoration, but the Standard class Picture is gone.
now i see the puzzle in the northeast but what is with the Standard class Picture ?
shape main
{

}
decoration PuzzlePiece
{
   orientation="NE";
   image("PuzzlePiece.emf",50,0,100,50);
}
Title: Re: Create Custom Picture for a Class Element
Post by: KP on June 07, 2016, 03:44:04 pm
Yes it works with decoration, but the Standard class Picture is gone.
now i see the puzzle in the northeast but what is with the Standard class Picture ?
shape main
{

}
decoration PuzzlePiece
{
   orientation="NE";
   image("PuzzlePiece.emf",50,0,100,50);
}

Get rid of the shape main in your shape script. You are overriding the main shape with a blank nothing. It's OK to have a shape script consisting of just a decoration without a shape main.
Title: Re: Create Custom Picture for a Class Element
Post by: Ceronimo on June 07, 2016, 04:33:50 pm
Thank you this worked perfect (stupid mistake -.-) !

One Last Question , how can iuse my emf files for the Pictures in the Project Tree ?
Title: Re: Create Custom Picture for a Class Element
Post by: Geert Bellekens on June 07, 2016, 04:46:49 pm
you have to make 16x16 bitmap images for the tooolbar and project browser icons.

Geert
Title: Re: Create Custom Picture for a Class Element
Post by: Uffe on June 07, 2016, 05:33:32 pm
... and specify the bitmap file as the initial value of the icon attribute (http://www.sparxsystems.com/enterprise_architect_user_guide/12.1/building_models/supportedattributes_2.html) (note: not _icon) in the stereotype element in your profile model.

This file is embedded in the MDG Technology XML file, so you only need it to be present at compile time.

/Uffe
Title: Re: Create Custom Picture for a Class Element
Post by: Ceronimo on June 07, 2016, 11:37:31 pm
Thanky you !
everything worked perfect !
 ;D ;D ;D