Book a Demo

Author Topic: Shape script issues  (Read 4943 times)

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
Shape script issues
« on: May 09, 2008, 09:25:43 am »
So, I've been blundering around trying to create distinctive appearances for a bunch of stereotypes ... nothing fancy, just some colors and line styles and I seem to be having a few issues with shape scripts ... possibly the expected thing, but it never hurts to ask.  Issues, include:

Providing a shape script for a connector such as
shape main
{
  setfillcolor(255,255,255);
  setpen(204,255,204,3);
  setlinestyle("dash");
  rectangle(0,0,100,0);
}

gives me a dashed green line ... sort of.  It doesn't color the arrowhead and the dashes are not always clear on the screen and in the printout they are more dash, dash space than even, particularly if at an angle, where they can get odd.

I would like to create a connector that was a double line or where the dashed line alternated with a different color (reason being that I have a number of connector stereotypes that appear in pairs, one summarizing the other at a higher level of component and I would like them to look similar, but have some distinctive aspect).  I was able to draw a second line inside the border of a rectangle to get a double line, but can't seem to get anything similar to work with connectors.  Penwidth, linestyle, and color all work, but I need one more variation.  The double line approach shows fine in the shape script display, but not on the diagram.  The best I have managed is to get a little extra color in there, but it may or may not show depending on line angle.

Ideas?


Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 8626
  • Karma: +259/-129
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Shape script issues
« Reply #1 on: July 29, 2008, 04:32:39 pm »
Hi Thomas,

I know it's a long time since your original post, but this might help in this particular case.

if you set noshadow=false; you will get the little shadow.  I think this corresponds to the status value for shapes, so you can't seem to set the field that would influence the colour of the "shadow" line.  But at least it allows "similarity with distinction".

HTH,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
Re: Shape script issues
« Reply #2 on: July 30, 2008, 02:22:53 am »
Shadow isn't enough of a distinction for me.  In fact, I am suppressing all shadows just to tidy things up.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Shape script issues
« Reply #3 on: July 30, 2008, 09:05:09 am »
This one seems to work:
Code: [Select]
shape main
{
      noshadow=true;
      setpencolor(255,0,0);
      moveto(0,-[highlight]10[/highlight]);
      lineto(100,-[highlight]10[/highlight]);
      setpencolor(0,255,0);
      moveto(0,[highlight]10[/highlight]);
      lineto(100,[highlight]10[/highlight]);
}
Change the highlighted numbers to increase or decrease the gap, to taste.

HTH
« Last Edit: July 30, 2008, 09:18:39 am by KP »
The Sparx Team
[email protected]

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
Re: Shape script issues
« Reply #4 on: July 30, 2008, 10:00:21 am »
I'll give it a try.