Book a Demo

Author Topic: How do I resize a shape automatically?  (Read 4367 times)

Sue Maurizio

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
How do I resize a shape automatically?
« on: July 14, 2009, 10:31:56 pm »
Hello,
I'm building a custom MDG technology and I created a shape script which only displays the name and the notes for an object (if any). The notes box, anyway, does not resize automatically when the text exceeds its width. I noticed that the default representation for classes, for example, is automatically resized, is there a way to do this using the shape scripts editor?
Thanks,
Sue Maurizio

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: How do I resize a shape automatically?
« Reply #1 on: July 15, 2009, 09:13:57 am »
Sorry, it's not currently possible.

I suggest that it's worth sending in a feature request.

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: How do I resize a shape automatically?
« Reply #2 on: July 15, 2009, 09:36:39 am »
You can try something like this:

Code: [Select]
shape main
{
    ...
    if(hasproperty("notes",""))
    {
        // empty notes, draw it small
        defsize(90,70);
    }
    else
    {
        // non-empty notes, draw it large
        defsize(90,200);
    }
    ...
}
Not ideal, but maybe worth experimenting with...
The Sparx Team
[email protected]

Sue Maurizio

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: How do I resize a shape automatically?
« Reply #3 on: July 15, 2009, 05:10:17 pm »
Thank you for your answers :)