Author Topic: Shape script Problem  (Read 2814 times)

BGMarc

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Shape script Problem
« on: July 31, 2011, 10:08:09 am »
Greetings, I would greatly appreciate any advice with a problem that I am having creating a custom connector type for a UML profile using the shape script feature.

The problem is fairly simple, I need to place the "@" symbol at the midpoint of the connector in the MiddleTopLabel position. I just can't figure out the right scripting to make it happen and the examples don't cover this situation (or very many others for that matter).

If anyone can point me towards more robust support material for shape scripting, I would also be eternally grateful. The brief, high-level overview in the help files is nice, but doesn't provide enough information for serious use.

Thanks in advance, Marc.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: Shape script Problem
« Reply #1 on: August 01, 2011, 09:36:29 am »
Try this:

Code: [Select]
label middletoplabel
{
      print("@");
}

label middlebottomlabel
{
      // hide the stereotype label
}
The Sparx Team
[email protected]

BGMarc

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Shape script Problem
« Reply #2 on: August 12, 2011, 10:41:55 am »
Thanks for the response. Unfortunately, the damned thing continues to display without the "@"  >:(

The script I am using is:
Code: [Select]
shape main
{
      // draw a dashed line
      noshadow=true;
      
      setlinestyle("dashed");
      moveto(0,0);
      lineto(100,0);
      
      label middletoplabel
      {
      print("@");
      }

      label middlebottomlabel
      {
      // hide the stereotype label
      }
}      

Any further advice would be greatly appreciated. Likewise, if there is a more comprehensive/advanced guide or whitepaper available on shape scripting I would really appreciate being pointed in its direction. I am doing a lot of this at the moment and am repeatedly running across issues that the current references don't address and I really don't want to wear out my welcome here asking questions that I could work out for myself with the right references.

Cheers
Marc