To explain, I have a hole named H1. I want to grab X,Y,Z,D values for this hole in a script run at the end of the part program.
I know at least 20 ways that do not work!
Your Products have been synced, click here to refresh
Sub Main() Dim PCDApp, PCDPartPrograms, PCDPartProgram, PCDCommands, PCDCommand Set PCDApp = CreateObject("PCDLRN.Application") Set PCDPartPrograms = PCDApp.PartPrograms Set PCDPartProgram = PCDApp.ActivePartProgram Set PCDCommands = PCDPartProgram.Commands Dim cnt as Integer Dim Tx, Ty, Tz, Td, Mx, My, Mz, Md as String for cnt = 1 to PCDCommands.Count Set PCDCommand = PCDCommands.Item(cnt) if PCDCommand.ID = "H1" then Tx = PCDCommand.GetText(THEO_X, 0) Ty = PCDCommand.GetText(THEO_Y, 0) Tz = PCDCommand.GetText(THEO_Z, 0) Td = PCDCommand.GetText(THEO_DIAM, 0) Mx = PCDCommand.GetText(MEAS_X, 0) My = PCDCommand.GetText(MEAS_Y, 0) Mz = PCDCommand.GetText(MEAS_Z, 0) Md = PCDCommand.GetText(MEAS_DIAM, 0) End If Next cnt End Sub
Sub Main() Dim PCDApp, PCDPartPrograms, PCDPartProgram, PCDCommands, PCDCommand Set PCDApp = CreateObject("PCDLRN.Application") Set PCDPartPrograms = PCDApp.PartPrograms Set PCDPartProgram = PCDApp.ActivePartProgram Set PCDCommands = PCDPartProgram.Commands Dim cnt as Integer Dim Tx, Ty, Tz, Td, Mx, My, Mz, Md as String for cnt = 1 to PCDCommands.Count Set PCDCommand = PCDCommands.Item(cnt) if PCDCommand.ID = "H1" then Tx = PCDCommand.GetText(THEO_X, 0) Ty = PCDCommand.GetText(THEO_Y, 0) Tz = PCDCommand.GetText(THEO_Z, 0) Td = PCDCommand.GetText(THEO_DIAM, 0) Mx = PCDCommand.GetText(MEAS_X, 0) My = PCDCommand.GetText(MEAS_Y, 0) Mz = PCDCommand.GetText(MEAS_Z, 0) Md = PCDCommand.GetText(MEAS_DIAM, 0) End If Next cnt End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |