If you want to represent an object differently using shapescript here is some code that shows an achimate application component normally but if the diagram has a stereotype of "BubbleChart" then it draws a circle.
I use this for showing a TIME (Tolerate, Invest, Migrate, Eliminate) quadrant diagram for application portfolio management on a bubble chart diagram but represent the same thing as an application component on other diagrams.
shape main
{
layouttype="border";
if(hasproperty("diagram.stereotype","BubbleChart"))
{
defsize(100,100);
ellipse(0,0,100,100);
addsubshape("padding","n");
addsubshape("bubblename","center");
}
else
{
defsize(90,70); //
rectangle(0,0,100,100);
addsubshape("padding","n");
if(hasproperty("rectanglenotation","0"))
{
addsubshape("port","w");
}
addsubshape("name","center");
}
shape bubblename
{
h_align="center";
println("#name#");
}
shape port
{
preferredwidth=20;
scalable=false;
rectangle(-10,-10,10,0);
rectangle(-10,10,10,20);
}
shape padding
{
preferredheight=15;
}
shape name
{
h_align="center";
print("#name#");
}
}
decoration component
{
orientation="ne";
if(hasproperty("diagram.stereotype", "BubbleChart"))
{
return;
}
if(hasproperty("rectanglenotation","0"))
{
return;
}
else
{
rectangle(0,0,60,100);
rectangle(-10,10,10,30);
rectangle(-10,50,10,70);
}
}