Your Products have been synced, click here to refresh
Begin VB.Form Form1 caption = "Visual Basic OLE Client for WinSPC" ClientHeight = 4485 ClientLeft = 60 ClientTop = 630 ClientWidth = 6150 LinkTopic = "Form1" ScaleHeight = 4485 ScaleWidth = 6150 Begin VB.TextBox Text1 Height = 4455 Left = 0 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 0 Top = 0 Width = 6135 End Begin VB.Menu RunMenu Caption = "&Run" End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredID = True Attribute VB_Expose = False Sub Main 'PCDMIS commands Dim ObjApp As Object Dim ObjCmds As Object Dim ObjCmd As Object Dim ObjPart As Object Dim ObjDimCmd As Object Dim lngNumCmds As Long Set ObjApp = CreateObject("PCDLRN.Application") Set ObjPart = ObjApp.ActivePartProgram Set ObjCmds = ObjPart.Commands Dim StrDimID As String Dim StrDimFeature As String Dim StrDimType As String Dim StrDimNominal As String Dim StrDimUTol As String Dim StrDimLTol As String Dim StrDimMeasure As String Dim StrDimDiameter As String Dim DimName As String Dim DimMeas As String Dim MeasZ As String Dim StrC1 As Double Dim MyReading1 As Double Dim MyReading2 As Double Dim MyReading3 As Double Dim MyReading4 As Double Dim MyReading5 As Double Dim MyReading6 As Double For Each ObjCmd In ObjCmds If ObjCmd.IsComment Then If ObjCmd.CommentCommand.CommentType = PCD_COMMENT_INPUT Then If ObjCmd.ID = "C1" Then StrC1 = ObjCmd.CommentCommand.Input End If End If End If If ObjCmd.IsDimension Then Set ObjDimCmd = ObjCmd.DimensionCommand StrDimID = ObjDimCmd.ID StrDimFeature = ObjDimCmd.Feat1 StrDimType = ObjDimCmd.AxisLetter StrDimNominal = ObjDimCmd.Nominal StrDimUTol = ObjDimCmd.Plus StrDimLTol = ObjDimCmd.Minus StrDimMeasure = ObjDimCmd.Measured ElseIf ObjCmd.IsFeature Then StrDimID = ObjCmd.FeatureCommand.ID StrDimDiameter = ObjCmd.FeatureCommand.MeasDiam MeasZ = ObjCmd.GetText(MEAS_Z,0) ElseIf (ObjCmd = FEATURE_CONTROL_FRAME) Then DimName = ObjCmd.ID DimMeasure = ObjCmd.GetFieldValue(LINE2_MEAS, 0) StrDimNominal = ObjCmd.GetFieldValue(LINE2_NOMINAL, 0) StrDimDev = ObjCmd.GetFieldValue(LINE2_DEV, 0) StrDimAct = StrDimNominal + StrDimDev End If If StrDimID = "CIR1- DIA UNDER GROOVE" Then MyReading1 = StrDimDiameter If DimName = "CIRC1 ROUNDNESS" Then MyReading2 = StrDimAct If StrDimID = "CIR2- DIA OF GROOVE" Then MyReading3 = StrDimDiameter If DimName = "CIR2- DIA OF GROOVE" Then MyReading4 = StrDimAct If StrDimID = "CIR3- DIA ABOVE GROOVE" Then MyReading5 = StrDimDiameter If DimName = "CIR3- DIA ABOVE GROOVE" Then MyReading6 = StrDimAct Next Dim dc As Object Dim CollectionPlanID As Object Dim Username As String Dim Password As String 'Open WinSPC and Collection Plan Set dc = CreateObject("WinSPC.DataCollectionAuto") dc.Visible = True dc.RunHeadless = False While dc.ReadyForLogin = "F" Wend dc.UserName = "1675 CMM" dc.Password = "1675" dc.CollectionPlanID = 8549 dc.TagIndex = 0 dc.TagValue = "P162610" dc.TagIndex = 1 dc.TagValue = StrC1 dc.CurrentStep = 0 dc.Value = MyReading1 dc.CurrentStep = 1 dc.Value = MyReading2 dc.CurrentStep = 2 dc.Value = MyReading3 dc.CurrentStep = 3 dc.Value = MyReading4 dc.CurrentStep = 4 dc.Value = MyReading5 dc.CurrentStep = 5 dc.Value = MyReading6 dc.CollectionPlanID = 0 dc.UserName = " " Set dc = Nothing End Sub
Begin VB.Form Form1 caption = "Visual Basic OLE Client for WinSPC" ClientHeight = 4485 ClientLeft = 60 ClientTop = 630 ClientWidth = 6150 LinkTopic = "Form1" ScaleHeight = 4485 ScaleWidth = 6150 Begin VB.TextBox Text1 Height = 4455 Left = 0 MultiLine = -1 'True ScrollBars = 2 'Vertical TabIndex = 0 Top = 0 Width = 6135 End Begin VB.Menu RunMenu Caption = "&Run" End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredID = True Attribute VB_Expose = False Sub Main 'PCDMIS commands Dim ObjApp As Object Dim ObjCmds As Object Dim ObjCmd As Object Dim ObjPart As Object Dim ObjDimCmd As Object Dim lngNumCmds As Long Set ObjApp = CreateObject("PCDLRN.Application") Set ObjPart = ObjApp.ActivePartProgram Set ObjCmds = ObjPart.Commands Dim StrDimID As String Dim StrDimFeature As String Dim StrDimType As String Dim StrDimNominal As String Dim StrDimUTol As String Dim StrDimLTol As String Dim StrDimMeasure As String Dim StrDimDiameter As String Dim DimName As String Dim DimMeas As String Dim MeasZ As String Dim StrC1 As Double Dim MyReading1 As Double Dim MyReading2 As Double Dim MyReading3 As Double Dim MyReading4 As Double Dim MyReading5 As Double Dim MyReading6 As Double For Each ObjCmd In ObjCmds If ObjCmd.IsComment Then If ObjCmd.CommentCommand.CommentType = PCD_COMMENT_INPUT Then If ObjCmd.ID = "C1" Then StrC1 = ObjCmd.CommentCommand.Input End If End If End If If ObjCmd.IsDimension Then Set ObjDimCmd = ObjCmd.DimensionCommand StrDimID = ObjDimCmd.ID StrDimFeature = ObjDimCmd.Feat1 StrDimType = ObjDimCmd.AxisLetter StrDimNominal = ObjDimCmd.Nominal StrDimUTol = ObjDimCmd.Plus StrDimLTol = ObjDimCmd.Minus StrDimMeasure = ObjDimCmd.Measured ElseIf ObjCmd.IsFeature Then StrDimID = ObjCmd.FeatureCommand.ID StrDimDiameter = ObjCmd.FeatureCommand.MeasDiam MeasZ = ObjCmd.GetText(MEAS_Z,0) ElseIf (ObjCmd = FEATURE_CONTROL_FRAME) Then DimName = ObjCmd.ID DimMeasure = ObjCmd.GetFieldValue(LINE2_MEAS, 0) StrDimNominal = ObjCmd.GetFieldValue(LINE2_NOMINAL, 0) StrDimDev = ObjCmd.GetFieldValue(LINE2_DEV, 0) StrDimAct = StrDimNominal + StrDimDev End If If StrDimID = "CIR1- DIA UNDER GROOVE" Then MyReading1 = StrDimDiameter If DimName = "CIRC1 ROUNDNESS" Then MyReading2 = StrDimAct If StrDimID = "CIR2- DIA OF GROOVE" Then MyReading3 = StrDimDiameter If DimName = "CIR2- DIA OF GROOVE" Then MyReading4 = StrDimAct If StrDimID = "CIR3- DIA ABOVE GROOVE" Then MyReading5 = StrDimDiameter If DimName = "CIR3- DIA ABOVE GROOVE" Then MyReading6 = StrDimAct Next Dim dc As Object Dim CollectionPlanID As Object Dim Username As String Dim Password As String 'Open WinSPC and Collection Plan Set dc = CreateObject("WinSPC.DataCollectionAuto") dc.Visible = True dc.RunHeadless = False While dc.ReadyForLogin = "F" Wend dc.UserName = "1675 CMM" dc.Password = "1675" dc.CollectionPlanID = 8549 dc.TagIndex = 0 dc.TagValue = "P162610" dc.TagIndex = 1 dc.TagValue = StrC1 dc.CurrentStep = 0 dc.Value = MyReading1 dc.CurrentStep = 1 dc.Value = MyReading2 dc.CurrentStep = 2 dc.Value = MyReading3 dc.CurrentStep = 3 dc.Value = MyReading4 dc.CurrentStep = 4 dc.Value = MyReading5 dc.CurrentStep = 5 dc.Value = MyReading6 dc.CollectionPlanID = 0 dc.UserName = " " Set dc = Nothing End Sub
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |