How to use panelSize properly from outside of a panel when name of panel is known?

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
3 posts • Page 1 of 1
flindecke
Posts:69
Joined: Wed Jun 24, 2015 1:54 pm

How to use panelSize properly from outside of a panel when name of panel is known?

Post by flindecke »

It want to get the current size of a panel.
WinCC OA provides the function panelSize for this purpose.

The following code (used inside of a panel) returns the current size in w and h of the panel itself:

Code: Select all

int w, h;
panelSize("", w, h, true);
Also the following code:

Code: Select all

int w, h;
panelSize(self.name, w, h, true);
When i have a shape and use its name outside of the panel for the function panelSize i will always get a warning 76, Invalid argument in function

Code: Select all

shape sh = getShape(...);
int w, h;
panelSize(sh.name, w, h, true);
Using ".:" does not work either.

Question: How to get the current panel size, when i have the shape instance?

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: How to use panelSize properly from outside of a panel when name of panel is known?

Post by mkoller »

Use getValue(".:", "size", w, h);

flindecke
Posts:69
Joined: Wed Jun 24, 2015 1:54 pm

Re: How to use panelSize properly from outside of a panel when name of panel is known?

Post by flindecke »

Thanks Martin

3 posts • Page 1 of 1