Book a Demo

Author Topic: Diagram element tagged values selection  (Read 4487 times)

rupertkiwi

  • EA User
  • **
  • Posts: 133
  • Karma: +5/-0
    • View Profile
Diagram element tagged values selection
« on: September 16, 2019, 03:50:00 pm »
Hi there,

Is in possible to only show certain tagged values for an element on a diagram? and not all of them?

Thanks,
Rupert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Diagram element tagged values selection
« Reply #1 on: September 16, 2019, 04:32:03 pm »
I think you only need a shapescript, no add-in.

Geert

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Diagram element tagged values selection
« Reply #2 on: September 16, 2019, 05:19:48 pm »
I agree with Geert, I think you only need a shapescript. I’ll dig some code out.
« Last Edit: September 17, 2019, 06:14:20 pm by Modesto Vega »

Sunshine

  • EA Practitioner
  • ***
  • Posts: 1353
  • Karma: +121/-10
  • Its the results that count
    • View Profile
Re: Diagram element tagged values selection
« Reply #3 on: September 17, 2019, 06:21:36 am »
Shapescript is probably the way to go if you are okay with associating the shapescript with a stereotype on your element.
Happy to help
:)

rupertkiwi

  • EA User
  • **
  • Posts: 133
  • Karma: +5/-0
    • View Profile
Re: Diagram element tagged values selection
« Reply #4 on: September 17, 2019, 11:07:46 am »
OK, if you have some code that would be great Modesto.

Thanks,
Rupert

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Diagram element tagged values selection
« Reply #5 on: September 17, 2019, 11:29:30 am »
Something like this will get you started:

Code: [Select]
shape main
{
layouttype="border";
rectangle(0,0,100,100);
addsubshape("title","N");
addsubshape("tags","CENTER");

shape title
{
bold=true;
h_align="CENTER";
preferredheight=20;
print("#name#");
moveto(0,100);
lineto(100,100);
}

shape tags
{
italic=true;
h_align="LEFT";
print("Tag1 = #tag:Tag1#");
}
}
The Sparx Team
[email protected]

rupertkiwi

  • EA User
  • **
  • Posts: 133
  • Karma: +5/-0
    • View Profile
Re: Diagram element tagged values selection
« Reply #6 on: September 17, 2019, 02:31:13 pm »
Thanks KP

Modesto Vega

  • EA Practitioner
  • ***
  • Posts: 1183
  • Karma: +30/-8
    • View Profile
Re: Diagram element tagged values selection
« Reply #7 on: September 18, 2019, 03:37:47 am »
Sorry for the delay. The following script should print the name and the Abbreviation TAG in the name compartment separated by 3 hyphens.

Code: [Select]
shape main{

dockable="standard";

noShadow=true;

rectangle(0,0,100,100);

setfontcolor(0, 0, 0);
setfillcolor(255,255,255);

addSubshape("stereotypecompartment", 100, 30);

addSubshape("namecompartment", 100, 100);

shape stereotypecompartment
{

h_align = "center";
v_align = "top";

editablefield = "stereotype";


println("#stereotype#");


}

shape namecompartment
{
h_align = "center";

editablefield = "name";

println("#name#");
println("#---#");
println("#TAG:Abbreviation#");

}
}