I have a small code in vb6 that changes the tolerances of the program but it is very time consuming. how can I write the code to be faster?
Attached Files
Your Products have been synced, click here to refresh
Sub test() Dim PCDApp, PCDPartProgram, PCDCommands, cmd As Object Dim VK, VT, Ptol, Mtol, retval, Ntext Set PCDApp = CreateObject("PCDLRN.Application") Set PCDPartProgram = PCDApp.ActivePartProgram Set PCDCommands = PCDPartProgram.Commands VK = 1 'VT = GT.Text VT = 2.5 Ptol = -(VT / 2 - 0.01) Mtol = (VT / 2 + 0.01) For Each cmd In PCDCommands Ntext = VK If cmd.IsDimension Then If cmd.ID = "" Then 'DCmd.Plus = Ptol retval = cmd.PutText(CStr(Ptol), F_PLUS_TOL, 0) 'DCmd.Minus = Mtol retval = cmd.PutText(CStr(Mtol), F_MINUS_TOL, 0) If (VK Mod 10) = 0 Then PCDApp.StatusBar = "Changing Toleranz, Command [" & CStr(VK) & "]" End If VK = VK + 1 End If End If Next cmd PCDPartProgram.RefreshPart Ntext = "<END>" End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |