Nee ik ben weer hard aan het werk
let op
Step 1: transform DIN XXXX from excel sheet to PCC StdGasket records
'
Sub FillList()
Dim Gasket As CStdGasket, ws As Worksheet
Dim row As Integer, Col As Integer
Dim Convert As New CStdNomODToDN
Set ws = Sheets("DIN2690")
Set mList = New Collection
For row = 7 To 49
For Col = 4 To 9
'
' Creaste a new VES standard gasket
'
Set Gasket = New CStdGasket
'
' Fixed data
'
Gasket.Stdname = "DIN 2690"
Gasket.TypeID = "FLAT FACE"
'
' One rating per column 2.5 ,6,10 etc.
'
Gasket.Rating = ws.Cells(6, Col).Value
Gasket.NennWeite = ws.Cells(row, 2).Value
Gasket.NomOD = Convert.DN_To_NomOD(Gasket.NennWeite) ' Convertion !!!!!!!!!
'
' Import gasket dimensions
'
' 1) Inside diameter
Gasket.D1 = ws.Cells(row, 3).Value
' 2) Outside diameter
Gasket.D0 = ws.Cells(row, Col).Value
' 3) Thickness 2 mm default
Gasket.t0 = 2
'
' Check if it is a valid gasket !
'
If IsNumeric(Gasket.D0) And Gasket.NennWeite > 4 Then
mList.Add Gasket
Else
' ????
End If
Next Col
Next row
ExportList mList
End Sub
'
' Export StdGasket collection to file (CSV)
'
Sub ExportList(list As Collection)
Dim Gasket As CStdGasket, ws As Worksheet
Dim row As Integer
'
'
'
Set ws = Sheets("Export")
ws.UsedRange.Clear ' Removes all data on export sheet
ws.Cells(1, 1).Value = "StdName"
ws.Cells(1, 2).Value = "TypeID"
ws.Cells(1, 3).Value = "Rating"
ws.Cells(1, 4).Value = "NomOD"
ws.Cells(1, 5).Value = "D0"
ws.Cells(1, 6).Value = "D1"
ws.Cells(1, 7).Value = "D2"
ws.Cells(1,

.Value = "D3"
ws.Cells(1, 9).Value = "t0"
ws.Cells(1, 10).Value = "t1"
ws.Cells(1, 11).Value = "t2"
ws.Cells(1, 12).Value = "NoGrooves"
'
'
'
row = 2
For Each Gasket In list
'
' Export gasket identifiers
'
ws.Cells(row, 1).Value = Gasket.Stdname
ws.Cells(row, 2).Value = Gasket.TypeID
ws.Cells(row, 3).Value = Gasket.Rating
ws.Cells(row, 4).Value = Gasket.NomOD
'
' gasket dimensions
'
ws.Cells(row, 5).Value = Gasket.D0
ws.Cells(row, 6).Value = Gasket.D1
ws.Cells(row, 7).Value = 0
ws.Cells(row,

.Value = 0
ws.Cells(row, 9).Value = Gasket.t0
ws.Cells(row, 10).Value = 0
ws.Cells(row, 11).Value = 0
ws.Cells(row, 12).Value = 0
'
' Goto next line
'
row = row + 1
Next Gasket
' close file
End Sub
dat heb ik geprogrameerd
