Your adjusted code (code below) working in direction dialog to script I need direction script to dialog.
['D D D
'Create Dialog With these Input items:
Begin Dialog DIALOG_1 50,10, 206, 80, "Save report"
Text 20,6,104,12, "Total measured dimensions:"
Text 20,20,124,12, "Do you want save measured data?"
OKButton 35,40,48,26
CancelButton 120,40,48,26
TextBox 118,5,37,12, .EditBox_1
End Dialog
' Set the Dialog For Access:
Dim Dialg As DIALOG_1
Dialg.EditBox_1 = "Text"
button1 = Dialog(Dialg)
' Declar VB variables:
Dim Progtype As String
'Quit If Dialog got canceled, Or go On To take the operator inputs And Put them into VB variables:
If button1 = 0 Then
Progtype= "END"
Else
'D D D
End If]
In the best case scenario script should count dimensions in/out of tolerance and results display in dialog. |So I need pass variable script to dialog or if it isn't possible then pc dmis to dialog.
['D D D
If Not OutTolValue is Nothing Then
OutTolValue.LongValue = 0
InTolValue =0
For Each Cmd In Cmds
If Cmd.Marked Then
If Cmd.IsDimension Then
If Cmd.Type <> DIMENSION_START_LOCATION And _
Cmd.Type <> DIMENSION_END_LOCATION And _
Cmd.Type <> DIMENSION_TRUE_START_POSITION And _
Cmd.Type <> DIMENSION_TRUE_END_POSITION Then
Set DCmd = Cmd.DimensionCommand
CheckDim = Cmd.GetText ( OUTPUT_TYPE, 0)
If CheckDim <> "" Then
ReportDim = CheckDim
End If
If ReportDim = "BOTH" Or ReportDim = "REPORT" Then
InTolValue= InTolValue +1
If (DCmd.OutTol ) > 0.00005 Then
OutTolValue.LongValue = OutTolValue.LongValue + 1
End If
ElseIf Cmd.Type = FEATURE_CONTROL_FRAME Then ' FCF
I = 1
FCFOT = Cmd.GetText (LINE2_OUTTOL, I)
While (Not OutOfTol) And (FCFOT <> "")
InTolValue= InTolValue +1
If Val(FCFOT) > 0.00005 Then
OutTolValue.LongValue = OutTolValue.LongValue + 1
End If
I = I + 1
FCFOT = Cmd.GetText (LINE2_OUTTOL, I)
Wend
I = 1
FCFOT = Cmd.GetText (LINE3_OUTTOL, I)
While (Not OutOfTol) And (FCFOT <> "")
InTolValue= InTolValue +1
If Val(FCFOT) > 0.00005 Then
OutTolValue.LongValue = OutTolValue.LongValue + 1
End If
I = I + 1
FCFOT = Cmd.GetText (LINE3_OUTTOL, I)
Wend
End If
End If
End If
End If
Next Cmd
'MsgBox OutTolValue.LongValue
If Not OutTolValue is Nothing Then
Program.SetVariableValue OutTolVar, OutTolValue
End If
Else
MsgBox "Variabeln " + OutTolVar + " saknas i PCDMIS-programmet!"
End If
MsgBox "Total measured dimensions: " & InTolValue & " Out of tolerance: " & OutTolValue.LongValue
'CountOutOfTol "OT"
'D D D
'Create Dialog With these Input items:
Begin Dialog DIALOG_1 50,10, 200, 80,"Save report", .Enable
'Text 20,10,200,12, "Total measured dimensions: & InTolValue"
Text 20,20,200,12, "Do you want save measured data?"
OKButton 35,40,48,26
CancelButton 120,40,48,26
End Dialog
' Set the Dialog For Access:
Dim Dialg As DIALOG_1
button1 = Dialog(Dialg)
' Declar VB variables:
Dim Progtype As String
'Quit If Dialog got canceled, Or go On To take the operator inputs And Put them into VB variables:
If button1 = 0 Then
Progtype= "END"
Else
'D D D]
Your adjusted code (code below) working in direction dialog to script I need direction script to dialog.
['D D D
'Create Dialog With these Input items:
Begin Dialog DIALOG_1 50,10, 206, 80, "Save report"
Text 20,6,104,12, "Total measured dimensions:"
Text 20,20,124,12, "Do you want save measured data?"
OKButton 35,40,48,26
CancelButton 120,40,48,26
TextBox 118,5,37,12, .EditBox_1
End Dialog
' Set the Dialog For Access:
Dim Dialg As DIALOG_1
Dialg.EditBox_1 = "Text"
button1 = Dialog(Dialg)
' Declar VB variables:
Dim Progtype As String
'Quit If Dialog got canceled, Or go On To take the operator inputs And Put them into VB variables:
If button1 = 0 Then
Progtype= "END"
Else
'D D D
End If]
In the best case scenario script should count dimensions in/out of tolerance and results display in dialog. |So I need pass variable script to dialog or if it isn't possible then pc dmis to dialog.
['D D D
If Not OutTolValue is Nothing Then
OutTolValue.LongValue = 0
InTolValue =0
For Each Cmd In Cmds
If Cmd.Marked Then
If Cmd.IsDimension Then
If Cmd.Type <> DIMENSION_START_LOCATION And _
Cmd.Type <> DIMENSION_END_LOCATION And _
Cmd.Type <> DIMENSION_TRUE_START_POSITION And _
Cmd.Type <> DIMENSION_TRUE_END_POSITION Then
Set DCmd = Cmd.DimensionCommand
CheckDim = Cmd.GetText ( OUTPUT_TYPE, 0)
If CheckDim <> "" Then
ReportDim = CheckDim
End If
If ReportDim = "BOTH" Or ReportDim = "REPORT" Then
InTolValue= InTolValue +1
If (DCmd.OutTol ) > 0.00005 Then
OutTolValue.LongValue = OutTolValue.LongValue + 1
End If
ElseIf Cmd.Type = FEATURE_CONTROL_FRAME Then ' FCF
I = 1
FCFOT = Cmd.GetText (LINE2_OUTTOL, I)
While (Not OutOfTol) And (FCFOT <> "")
InTolValue= InTolValue +1
If Val(FCFOT) > 0.00005 Then
OutTolValue.LongValue = OutTolValue.LongValue + 1
End If
I = I + 1
FCFOT = Cmd.GetText (LINE2_OUTTOL, I)
Wend
I = 1
FCFOT = Cmd.GetText (LINE3_OUTTOL, I)
While (Not OutOfTol) And (FCFOT <> "")
InTolValue= InTolValue +1
If Val(FCFOT) > 0.00005 Then
OutTolValue.LongValue = OutTolValue.LongValue + 1
End If
I = I + 1
FCFOT = Cmd.GetText (LINE3_OUTTOL, I)
Wend
End If
End If
End If
End If
Next Cmd
'MsgBox OutTolValue.LongValue
If Not OutTolValue is Nothing Then
Program.SetVariableValue OutTolVar, OutTolValue
End If
Else
MsgBox "Variabeln " + OutTolVar + " saknas i PCDMIS-programmet!"
End If
MsgBox "Total measured dimensions: " & InTolValue & " Out of tolerance: " & OutTolValue.LongValue
'CountOutOfTol "OT"
'D D D
'Create Dialog With these Input items:
Begin Dialog DIALOG_1 50,10, 200, 80,"Save report", .Enable
'Text 20,10,200,12, "Total measured dimensions: & InTolValue"
Text 20,20,200,12, "Do you want save measured data?"
OKButton 35,40,48,26
CancelButton 120,40,48,26
End Dialog
' Set the Dialog For Access:
Dim Dialg As DIALOG_1
button1 = Dialog(Dialg)
' Declar VB variables:
Dim Progtype As String
'Quit If Dialog got canceled, Or go On To take the operator inputs And Put them into VB variables:
If button1 = 0 Then
Progtype= "END"
Else
'D D D]