I was wondering if there is a script out there
that might be similar to PCD2EXCEL but
would write data to a word document.
For example, I'd like to write the min/max values
of a feature set to specific fields of a word document.
Here's an example, given this simple PC-DMIS program -
STARTUP =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
ALIGNMENT/END
MODE/MANUAL
FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
LOADPROBE/SP25_1
TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
TRACEFIELD/DISPLAY,LIMIT=15 ; Name : Don
PLN1 =FEAT/PLANE,CARTESIAN,TRIANGLE
THEO/<2.4,1.4,2.6>,<-0.0308206,0.8257948,-0.563128>
ACTL/<2.4,1.4,2.6>,<-0.0308206,0.8257948,-0.563128>
MEAS/PLANE,5
HIT/BASIC,NORMAL,<2,0,2>,<-0.0308206,0.8257948,-0.563128>,<2,0,2>,USE THEO=YES
HIT/BASIC,NORMAL,<0,1,1>,<-0.0308206,0.8257948,-0.563128>,<0,1,1>,USE THEO=YES
HIT/BASIC,NORMAL,<6,0,0>,<-0.0308206,0.8257948,-0.563128>,<6,0,0>,USE THEO=YES
HIT/BASIC,NORMAL,<3,4,6>,<-0.0308206,0.8257948,-0.563128>,<3,4,6>,USE THEO=YES
HIT/BASIC,NORMAL,<1,2,4>,<-0.0308206,0.8257948,-0.563128>,<1,2,4>,USE THEO=YES
ENDMEAS/
FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL,MAXMIN,
DIM FLAT1= FLATNESS OF PLANE PLN1 UNITS=MM ,$
GRAPH=OFF TEXT=OFF MULT=1.00 ARROWDENSITY=100 OUTPUT=BOTH
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL MAX MIN
M 0.000 0.100 0.000 1.451 1.451 1.351 0.645 -0.806 -----
and this Word document -
The max value is MAXX and the min value is MINN
with Word bookmarks (named Maxx and Minn) at the two locations, this WordBASIC script will replace the two fields with min and max values from PC-DMIS -
Private Sub Form_Load()
Dim App As PCDLRN.Application
Dim Part As PCDLRN.PartProgram
Dim Cmds As PCDLRN.Commands
Dim Cmd As PCDLRN.Command
Set App = CreateObject("PCDLRN.Application")
Set Part = App.ActivePartProgram
Set Cmds = Part.Commands
CmdCnt = Cmds.Count
For Each Cmd In Cmds
If Cmd.TypeDescription = "Dimension Flatness" Then
Maxval = Cmd.GetText(DIM_MAX, 0)
Minval = Cmd.GetText(DIM_MIN, 0)
End If
Next Cmd
With ActiveDocument
.Bookmarks("Maxx").Range.Text = Maxval + " "
.Bookmarks("Minn").Range.Text = Minval + " "
End With
Here's an example, given this simple PC-DMIS program -
STARTUP =ALIGNMENT/START,RECALL:USE_PART_SETUP,LIST=YES
ALIGNMENT/END
MODE/MANUAL
FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, ,
LOADPROBE/SP25_1
TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
TRACEFIELD/DISPLAY,LIMIT=15 ; Name : Don
PLN1 =FEAT/PLANE,CARTESIAN,TRIANGLE
THEO/<2.4,1.4,2.6>,<-0.0308206,0.8257948,-0.563128>
ACTL/<2.4,1.4,2.6>,<-0.0308206,0.8257948,-0.563128>
MEAS/PLANE,5
HIT/BASIC,NORMAL,<2,0,2>,<-0.0308206,0.8257948,-0.563128>,<2,0,2>,USE THEO=YES
HIT/BASIC,NORMAL,<0,1,1>,<-0.0308206,0.8257948,-0.563128>,<0,1,1>,USE THEO=YES
HIT/BASIC,NORMAL,<6,0,0>,<-0.0308206,0.8257948,-0.563128>,<6,0,0>,USE THEO=YES
HIT/BASIC,NORMAL,<3,4,6>,<-0.0308206,0.8257948,-0.563128>,<3,4,6>,USE THEO=YES
HIT/BASIC,NORMAL,<1,2,4>,<-0.0308206,0.8257948,-0.563128>,<1,2,4>,USE THEO=YES
ENDMEAS/
FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL,MAXMIN,
DIM FLAT1= FLATNESS OF PLANE PLN1 UNITS=MM ,$
GRAPH=OFF TEXT=OFF MULT=1.00 ARROWDENSITY=100 OUTPUT=BOTH
AX NOMINAL +TOL -TOL MEAS DEV OUTTOL MAX MIN
M 0.000 0.100 0.000 1.451 1.451 1.351 0.645 -0.806 -----
and this Word document -
The max value is MAXX and the min value is MINN
with Word bookmarks (named Maxx and Minn) at the two locations, this WordBASIC script will replace the two fields with min and max values from PC-DMIS -
Private Sub Form_Load()
Dim App As PCDLRN.Application
Dim Part As PCDLRN.PartProgram
Dim Cmds As PCDLRN.Commands
Dim Cmd As PCDLRN.Command
Set App = CreateObject("PCDLRN.Application")
Set Part = App.ActivePartProgram
Set Cmds = Part.Commands
CmdCnt = Cmds.Count
For Each Cmd In Cmds
If Cmd.TypeDescription = "Dimension Flatness" Then
Maxval = Cmd.GetText(DIM_MAX, 0)
Minval = Cmd.GetText(DIM_MIN, 0)
End If
Next Cmd
With ActiveDocument
.Bookmarks("Maxx").Range.Text = Maxval + " "
.Bookmarks("Minn").Range.Text = Minval + " "
End With