Book a Demo

Author Topic: Shape script for a box with no fill  (Read 6992 times)

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Shape script for a box with no fill
« on: October 16, 2013, 08:44:55 am »
Hi there.  How do I create a shape script for a rectangle with either no fill or a transparent fill.

I want to stereotype a UML node as a network but have it behave graphically like a boundary, rather than your standard 3D filled box.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Shape script for a box with no fill
« Reply #1 on: October 16, 2013, 08:51:26 am »
Use strokepath(), e.g.:

Code: [Select]
shape main
{
    startpath();
    rectangle(0,0,100,100);
    endpath();
    strokepath();
}
« Last Edit: October 16, 2013, 08:52:38 am by KP »
The Sparx Team
[email protected]

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Shape script for a box with no fill
« Reply #2 on: October 16, 2013, 09:24:25 am »
Thanks.  Can I do anything to the pen beyond changing the colour and thickness?  aka can I draw dotted lines or similiar with strokepath?

Glassboy

  • EA Practitioner
  • ***
  • Posts: 1367
  • Karma: +112/-75
    • View Profile
Re: Shape script for a box with no fill
« Reply #3 on: October 16, 2013, 09:27:58 am »
Belay that question.  I found setlinestyle . :D

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Shape script for a box with no fill
« Reply #4 on: October 16, 2013, 09:28:40 am »
Yes, look in the help for SetLineStyle.

[edit]Ah, you beat me to it![/edit]
« Last Edit: October 16, 2013, 09:36:37 am by KP »
The Sparx Team
[email protected]