Book a Demo

Author Topic: Shapescript Creation Tip: Over-sized Decorations  (Read 3489 times)

William McKenzie

  • EA User
  • **
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Shapescript Creation Tip: Over-sized Decorations
« on: July 14, 2012, 08:35:10 am »
The documentation says that decorations are drawn in a 16x16 square, and they are; but you can overflow that square. By specifying a rectangle of -200,0,100,300 you can triple the size of the decoration, and use an emf image to get a really nice picture. Like the decoration, this is absolutely sized, and will not scale with the rectangle. I found this particularly useful in a deployment diagram, as shown, where I will primarily use the location as a container for other objects. An enumerated tag lets my users easily identify classes of deployment locations that are relevant to our business.

Code: [Select]
decoration location
{
      orientation="ne";
      
      if(hasproperty("rectanglenotation","0"))
      {
      }
      else
      {
            if (hastag("environment", "offshore"))
            {      
                  image("Chevron::Platform.emf",-200,0,100,300);
            }
            else if (hastag("environment", "datacenter"))
            {      
                  image("Chevron::Datacenter.emf",-200,0,100,300);
            }
            else
            {      
                  image("Chevron::Office.emf",-200,0,100,300);
            }
      }
}



~Bill

William McKenzie

  • EA User
  • **
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Re: Shapescript Creation Tip: Over-sized Decoratio
« Reply #1 on: July 14, 2012, 08:45:10 am »
Oops, meant to post this to Automation board. Maybe the moderator can move it?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Shapescript Creation Tip: Over-sized Decoratio
« Reply #2 on: July 16, 2012, 09:13:46 am »
Quote
Oops, meant to post this to Automation board. Maybe the moderator can move it?
Too easy  8-)
The Sparx Team
[email protected]