Book a Demo

Author Topic: inline edit element names  (Read 2875 times)

CorB

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
inline edit element names
« on: January 23, 2023, 03:04:04 am »
Hello,

Is it possible to provide inline editing element names on a diagram for elements that I defined myself in an add-in?

regards

CorB

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: inline edit element names
« Reply #1 on: January 26, 2023, 04:08:04 am »
Maybe this is stupid question but I created an MDG/Add-In with several element types and their accompanying Shape Scripts. I would like to add Elements to a Diagram from my Toolbox and edit their Name inline on the diagram. How can that be accomplished?

Thanks in advance, regards, Cor

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: inline edit element names
« Reply #2 on: January 26, 2023, 05:30:38 am »
You can use the editablefield property

Example:

Code: [Select]
shape main
{

DefSize(130,75);
AddSubShape("process",100,100);
if (HasProperty("stereotypehidden","true"))
{
addSubShape("name",100,10,0,-90);
}else
{
addSubShape("stereotype",100,10,0,-95);
addSubShape("name",100,10,0,-90);
}

shape process
{


StartPath();
lineto(85,0);
lineto(100,50);
lineto(85,100);
lineto(0,100);
lineto(15,50);
lineto(0,0);
endpath();
FillAndStrokePath();

}
shape name
{
h_align = "center";
v_align = "TOP";
editablefield = "name";
PrintWrapped("#name#");
}

shape stereotype
{
h_align = "center";
v_align = "TOP";
editablefield = "stereotype";
println("«#stereotype#»");
}

}
Geert

CorB

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: inline edit element names
« Reply #3 on: January 26, 2023, 09:43:05 pm »
Oops, I missed that in the Shape Script descriptions. Thanks!

kind regards, Cor