Hi all,
We have one panel which contains a rectangle (Panel_1). This panel is referenced inside another panel (Panel_2).
We would like to set the position of the rectangle in a script on Panel_1 using something like "this.position(x,y);"
However, we would like the coordinates (x,y) to refer to the coordinates inside Panel_1, not Panel_2. So in this case, if multiple examples of Panel_1 are referenced, they would all be visible in their own location, not moved all to the same position.
Instead, what happens is that the coordinates refer to the location within Panel_2, and the rectangles all end up in exactly the same position.
Is there a way to make position commands refer to the position within the original panel? I've explored the panel reference options and documentation, and haven't managed to find anything.
Kind regards,
Angus Heyworth
How to set position of object in panel reference?
Search
Re: How to set position of object in panel reference?
To change the position (referring to the current position) you can
-- read the current position
-- calculate the new position
-- set the new position
Best Regards
Leopold Knipp
Senior Support Specialist
-- read the current position
-- calculate the new position
-- set the new position
Best Regards
Leopold Knipp
Senior Support Specialist
Re: How to set position of object in panel reference?
Thanks Leopold.
Yes, I agree that is a possible method. Reading the current position of the object itself can have some disadvantages though, depending on the application. When the reading is repeated (for example if it is triggered on a DP-connect to represent a process value), the object can continually move further and further down the page away from its intended position.
The solution we used is to place a static object (could be an invisible line) in the panel, then measure everything from that object. IE:
-- read the position of the static object
-- calculate the new position
-- set the new position
Yes, I agree that is a possible method. Reading the current position of the object itself can have some disadvantages though, depending on the application. When the reading is repeated (for example if it is triggered on a DP-connect to represent a process value), the object can continually move further and further down the page away from its intended position.
The solution we used is to place a static object (could be an invisible line) in the panel, then measure everything from that object. IE:
-- read the position of the static object
-- calculate the new position
-- set the new position