Book a Demo

Author Topic: I need help with shapescript  (Read 3053 times)

matti123

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
I need help with shapescript
« on: February 21, 2012, 08:54:31 pm »
Hello everyone!

I'm new here and I need your help. I have problem with one of example script in Enterprise Architect User Guide

// EDITABLE FIELD SHAPE

shape main

{

rectangle(0,0,100,100);

 

addsubshape("namecompartment", 100, 20);

addsubshape("stereotypecompartment", 100, 40);

 

shape namecompartment

{

h_align = "center";

editablefield = "name";

 

rectangle(0,0,100,100);

println("name: #name#");

}

 

shape stereotypecompartment

{

h_align = "center";

editablefield = "stereotype";

 

rectangle(0,0,100,100);

println("stereotype: #stereotype#");

}


}

What should I do to autoresize my shape depends on how long is  my #name#. In this example when the #name# is too long it is out of the rectangle.

I hope you understand me becouse my english is not very good:)






qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: I need help with shapescript
« Reply #1 on: February 22, 2012, 07:18:27 am »
There's one attribute to set (those starting with an underline; something like _defaultsize?). But you can only set it statically and it must be one of the first statements. So (I might be wrong) it is not possible to set it dynamically. You might try it, though.

q.

matti123

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: I need help with shapescript
« Reply #2 on: February 22, 2012, 08:13:08 pm »
I tried to  use attribute defsize and few others attributes and drawing methods and I reached the conclusion that it not possible to do it dynamically.

Your post confirmed that :)

Thanks for your reply.