Welcome, Guest
Username: Password: Remember me

TOPIC: Changing graphical object properties in Groups

Changing graphical object properties in Groups 4 years 3 months ago #1070

  • IanB
  • IanB's Avatar
Hi
I am now familiar with modifying graphical object properties from a script and that works fine.
But I would like to treat a set of graphical objects as a group so that I can move them around the screen as a single entity. This I can also do.
But now I want to also modify the properties of the object within the group, and this I do not know how to do.

As a worked example my graphical object is a simple rectangle called myRectangle and is contained within the group named myGroup.
And I want to change its fillcolor to Red.

string cRed = "#ff0000";
Objects.myRectangle.fillcolor = cRed;
The above code works fine if the object is directly on the screen, but not if the object is inside a group.

I thought the following code might work, but it doesn't
Objects.myGroup.myRectangle.fillcolor = cRed;

Is there any way to change the fillcolour of a rectangle if it is within a group.
Thanks
Ian
The administrator has disabled public write access.

Changing graphical object properties in Groups 4 years 3 months ago #1071

  • fatkhrus
  • fatkhrus's Avatar
  • Offline
  • Administrator
  • Posts: 852
  • Thank you received: 126
  • Karma: -108
Hello,

No, it's not possible to do like you want in script. Scripts let you use only one level commands with objects. But you can bind color to the tag in properties of the graphical object and by
changing tag's value, change color of the object. To do this you have to choose "Tag.PV in the range" in color properties. See attached file.

Best regards,
Ruslan
The administrator has disabled public write access.
The following user(s) said Thank You: IanB

Changing graphical object properties in Groups 4 years 3 months ago #1072

  • IanB
  • IanB's Avatar
Thanks for reply Ruslan
I now assume that only the object properties that can be edited in a structured text script are the ones shown in the code that I see when I export a screen.. eg for a rectangle object:

<objectView class="tesla.scada2.model.objects.RectangleView" name="T01_AS" posx="40.0" posy="32.0" width="40.0" height="40.0" angle="0" lock="false" color="0xff0000ff" linewidth="0" fill="true" fillcolor="0xff0000ff"/>

In this case: posx, posy, width, height, angle, lock, color, linewidth, fill, fillcolor. Is that correct?
Ian
The administrator has disabled public write access.

Changing graphical object properties in Groups 4 years 3 months ago #1073

  • fatkhrus
  • fatkhrus's Avatar
  • Offline
  • Administrator
  • Posts: 852
  • Thank you received: 126
  • Karma: -108
Yes, you're right.

Best regards,
Ruslan
The administrator has disabled public write access.
Go to top