2/26/2021 9:18 AM | |
Joined: 7/15/2020 Last visit: 1/14/2024 Posts: 12 Rating: (0) |
Hi, I try with below code but I get error when compile and i am not sure how to fix it. I want to test the code given by Stebo. I am using TIA V15.1 and WinCC RT Prof. Anyone can help? Thanks Sub ChangePolygonIndexPos() On Error Resume Next Dim objPolygon Dim iPosX, iPosY, iCounter Dim strResult iCounter = 1 Set objPolygon = ActiveScreenItem.HMIObjects("Polygon1") For iCounter = 1 To objPolygon.PointCount With objPolygon .index = iCounter .ActualPointLeft = .ActualPointLeft - 50 .ActualPointTop = .ActualPointTop - 50 End With strResult = strResult & vbCrLf & "Corner " & iCounter & ": x=" & iPosX & " y=" & iPosY Next iCounter Debug.Print strResult CreateObject(Polygon) Set objPolygon = Nothing End Sub ------------------------------------------------------------------------------------------ |
Last edited by: Jen_Moderator at: 02/26/2021 13:17:12New subject after splitting |
|
Follow us on