Is there a way to get and set coordinates of a given element using IEC code?
"Get" would return the current coordinates. E.g. for line it would be two coordinate pairs.
"Set" would move the element to the given coordinates. I.e. I would like to move an element to an exact position instead of relative movement to the original position.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Are there any plans to include such feature in the future? I'm familiar with the absolute and relative movement but I'd like to position some components to exact positions using coordinates regardless of their "original" position.
π
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would like to make sure and, if necessary, move elements to exactly correct positions when the PLC starts. I'd like to prevent problems that might occur if some elements are accidentally moved.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you use absolute movement and place the objects at 0,0 you can achieve the same effect. But this not solves your problem of "accidentally moving" some elements.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes, I'm aware of absolute and relative movement. Unfortunately, they don't allow me to define exact coordinates in pixels regardless of the original position of the element.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"You want to override project changes during when the runtime is live and the application is running?"
Yes, in general, I would like to get a more programmatic way to position elements. Also adding elements using IEC languages would be very nice to create more dynamic user interfaces.
However, I think access control will be the solution for this specific problem.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there a way to get and set coordinates of a given element using IEC code?
"Get" would return the current coordinates. E.g. for line it would be two coordinate pairs.
"Set" would move the element to the given coordinates. I.e. I would like to move an element to an exact position instead of relative movement to the original position.
more posts ...
Hello @pekkallio,
no this is currently not possible.
There is however the possibility to move an element by Absolute and Relative Movement.
Best regards,
Marcel
Thank you for your answer!
Are there any plans to include such feature in the future? I'm familiar with the absolute and relative movement but I'd like to position some components to exact positions using coordinates regardless of their "original" position.
Hey,
no, there are currently no plans in the near future.
I noted your request at the respective issue.
Could you maybe explain to me what you are trying to do?
Best regards,
Marcel
Hi Marcel,
I would like to make sure and, if necessary, move elements to exactly correct positions when the PLC starts. I'd like to prevent problems that might occur if some elements are accidentally moved.
If you use absolute movement and place the objects at 0,0 you can achieve the same effect. But this not solves your problem of "accidentally moving" some elements.
Yes, I'm aware of absolute and relative movement. Unfortunately, they don't allow me to define exact coordinates in pixels regardless of the original position of the element.
I don't get it. You want to override project changes during when the runtime is live and the application is running?
Then you could prevent changes to the objects with this feature https://help.codesys.com/webapp/_cds_protecting_objects_from_access;product=codesys
Best regards,
Marcel
"You want to override project changes during when the runtime is live and the application is running?"
Yes, in general, I would like to get a more programmatic way to position elements. Also adding elements using IEC languages would be very nice to create more dynamic user interfaces.
However, I think access control will be the solution for this specific problem.
Ahh ok, now I understand you.
You prefer the dynamic approach more ;)