We are just getting started with this idea. But it will move quickly.
|
FeatureCAM Setup Sheet for CALIPER.FM |
|||||
|
Date 9/20/2002 |
|||||
| Operation | Feature | Speed | Feed | Tool | |
| fc1:z[0] | fc1 | 4200 | 0.008 | facemill3150 | |
| pb1_topdog_1:r[1] | pb1_topdog_1 | 2483 | 0.010 | endmill1000:reg | |
| pb1_topdog_1:f[2] | pb1_topdog_1 | 3820 | 0.006 | endmill1000:reg | |
| hl2:s[3] | hl2 | 2480 | 0.006 | center_5 | |
| hl2:s[4] | hl2 | 2480 | 0.006 | center_5 | |
| hl2:d[5] | hl2 | 3056 | 0.005 | TD_03125_5|16:J | |
| hl2:d[6] | hl2 | 3056 | 0.005 | TD_03125_5|16:J | |
| hl2:t[7] | hl2 | 760 | 0.062 | tap3|8-16UNC:H3:3:GB | |
| hl2:t[8] | hl2 | 760 | 0.062 | tap3|8-16UNC:H3:3:GB | |
| pb1_middog_1:r[9] | pb1_middog_1 | 2483 | 0.010 | endmill1000:reg | |
| pb1_middog_1:f[10] | pb1_middog_1 | 3820 | 0.006 | endmill1000:reg | |
| pb1_batwings:r-1[11] | pb1_batwings | 2483 | 0.010 | endmill1000:reg | |
| pb1_batwings:r-2[12] | pb1_batwings | 3611 | 0.007 | endmill0687:reg | |
| pb1_batwings:f[13] | pb1_batwings | 4200 | 0.004 | endmill0687:reg | |
| pp1_pistonbore:r[14] | pp1_pistonbore | 3973 | 0.006 | endmill0625:reg | |
| pp1_pistonbore:f[15] | pp1_pistonbore | 4200 | 0.004 | endmill0625:reg | |
| hl1:s[16] | hl1 | 4200 | 0.002 | center_3 | |
| hl1:d[17] | hl1 | 4200 | 0.002 | TD_01250_1|8:J | |
Option Explicit
Sub Main
' declare our variables to refer to our document, a feature, and an operation
Dim doc As FMDocument
Dim feat As FMFeature
Dim oper As FMOperation
Dim fs As Scripting.FileSystemObject, f As Scripting.TextStream
Set fs = New FileSystemObject
Set f = fs.OpenTextFile("C:\setupSheet.html", ForWriting, True)
' get the active document from the Application object
Set doc = ActiveDocument
Dim s As String
f.WriteLine "<table border=""1"" cellpadding=""2"" cellspacing=""0"">"
f.WriteLine "<tr><td colspan=""6""><b><big><p align=""center"">FeatureCAM Setup Sheet for " & doc.Name & "</big></b></td></tr>"
f.WriteLine "<tr><td colspan=""6""><b><big><p align=""center"">Date " & Date & "</big></b></td></tr>"
s = ""
s = s & addColumn( "Operation", True )
s = s & addColumn( "Feature", True )
s = s & addColumn( "Speed", True )
s = s & addColumn( "Feed", True )
s = s & addColumn( "Tool", True )
f.WriteLine HTMLRow( s )
' loop through all of the operations
For Each oper In doc.Operations
s = ""
s = s & addColumn( oper.Name )
s = s & addColumn( oper.Feature.Name )
s = s & addColumn( Format$( oper.Speed, "#" ) )
s = s & addColumn( Format$( oper.Feed, "0.000" ) )
s = s & addColumn( oper.Tool.Name )
f.WriteLine HTMLRow( s )
Next
f.WriteLine "</table>"
Set f = Nothing
Set fs = Nothing
End Sub
Private Function addColumn( s As String, Optional ByVal bold As Boolean ) As String
If bold Then
addColumn = "<td><b>" & s & "</b></td>"
Else
addColumn = "<td>" & s & "</td>
End If
End Function
Private Function HTMLRow( s As String ) As String
HTMLRow = "<tr>" & s & "</tr>"
End Function