社区活动 技术论坛 请教一个用VBA提取测量结果的问题
请教一个用VBA提取测量结果的问题
2011-08-29 20:45 59 0 3
前阵子看到坛子上一高手写的用VBA提取测量结果到excel的函数,请教如果我只想要特定的一点,如点38的X值,该如何操作 Private Sub CommandButton1_Click() On Error GoTo abc: Dim app As Object Set app = CreateObject("pcdlrn.application") Dim part As Object Set part = app.ActivePartProgram Dim cmds As Object Set cmds = part.Commands Dim cmd As PCDLRN.Command Dim featName As String Dim measX, measY, measZ, measT As String Dim theoX, theoY, theoZ As String Dim ii As Integer ii = 2 For Each cmd In cmds If cmd.IsMeasuredFeature Or cmd.IsDCCFeature Then featName = cmd.ID measX = cmd.GetText(MEAS_X, 0) measY = cmd.GetText(MEAS_Y, 0) measZ = cmd.GetText(MEAS_Z, 0) theoX = cmd.GetText(THEO_X, 0) theoY = cmd.GetText(THEO_Y, 0) theoZ = cmd.GetText(THEO_Z, 0) Cells(ii, 1) = featName Cells(ii, 2) = theoX Cells(ii, 3) = theoY Cells(ii, 4) = theoZ Cells(ii, 5) = measX Cells(ii, 6) = measY Cells(ii, 7) = measZ ii = ii + 1 End If Next Exit Sub abc: MsgBox "pcdmis没有打开" End Sub
我要回复

登陆后才能评论

登录
所有回贴(0)
在线咨询
关注我们

海克斯康制造智能

电话咨询
400-6580-400

热线电话(工作时间8:30-17:30)

关注我们 电话咨询 在线咨询

海克斯康制造智能