Change color of a shape group inside a ref

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
5 posts • Page 1 of 1
jonred
Posts:36
Joined: Mon Mar 06, 2017 10:24 am

Change color of a shape group inside a ref

Post by jonred »

Hi

Ia m developing an algorithm for changing the color of the lines of an electric diagram representation.
I have created a panel ref with the switches and the lines conecting them and a script to change the color of the lines using setValue.
The problem is that i group the lines in the panel ref and the setValue function does not change the color. for example:
- setValue("Ref1.LineA","color","Red") works perfectly
- setValue("Ref1.shapeGroupA", "color", "Red") does not work

if i create a group in the main panel it works well, but not inside the ref.

¿What could be the solution ?

Thank you very much

adaneau
Posts:310
Joined: Tue Feb 21, 2012 9:49 am

Re: Change color of a shape group inside a ref

Post by adaneau »

Hi,

If you use 3,15, you can probably build a public function or a property doing that in your ref and just call it from outside. See OOP in online help for more information

jonred
Posts:36
Joined: Mon Mar 06, 2017 10:24 am

Re: Change color of a shape group inside a ref

Post by jonred »

i have taken a look, but i have to study it more.
is possible to create in the ref an event to detect the change of the color of a line and change some other color lines?
Somethinh like that?

adaneau
Posts:310
Joined: Tue Feb 21, 2012 9:49 am

Re: Change color of a shape group inside a ref

Post by adaneau »

I can see 2 solutions:

1)
In scope of ref:
#property color gCol

setGCol(string col)
{
setVMultiValue("LineA","color",col,"LineB","color",col,"LineC","color",col,...);

string getGCol()
{
return LineA.color;
}

In parent panel: ref1.gCol = "red";

2)
In scope of ref:
public void changeGroupColor(string col)
{
setVMultiValue("LineA","color",col,"LineB","color",col,"LineC","color",col,...);
}

In parent panel: ref1.changeGroupColor("red");

jonred
Posts:36
Joined: Mon Mar 06, 2017 10:24 am

Re: Change color of a shape group inside a ref

Post by jonred »

thank you for your answer, at the moment i'am with other topics, but i will try it when i can.

5 posts • Page 1 of 1