M
mp
trying the following, calculating some values and writing to a comma delim
file.
the file is getting created but it's always blank
what am i missing?
Sub test()
Dim oCSVFile As System.IO.StreamWriter = Nothing
m_sMoldPartFile = "Filename.txt"
oCSVFile = My.Computer.FileSystem.OpenTextFileWriter(m_sMoldPartFile, True)
For Each blockref As Object In m_ssetProfiles
'now read the profiles, figure out the cut lengths, write to textfile opened
above
GetFormCutListFromProfileBlock(blockref, oCSVFile)
End If
Next
'after looping and writing to file, close it
If Not oCSVFile Is Nothing Then
oCSVFile.Close()
End If
End Sub
'def
Sub GetFormCutListFromProfileBlock(ByVal blockref As AcadBlockReference,
ByVal oCSVFile As System.IO.StreamWriter)
''calculate stuff then write to file
Dim CommaDelimLine As String = sQty & "," & _
sMoldPartName & "," & _
sWidthLiner & "," & _
sLengthLiner & "," & _
m_sMatlLinername & "," & _
m_ssheetwidth & "," & _
m_ssheetthick & "," & _
m_shasgrain & "," & _
sLabeltest
'send composed line to file
AppendToCsvFile2(CommaDelimLine, oCSVFile)
file.
the file is getting created but it's always blank
what am i missing?
Sub test()
Dim oCSVFile As System.IO.StreamWriter = Nothing
m_sMoldPartFile = "Filename.txt"
oCSVFile = My.Computer.FileSystem.OpenTextFileWriter(m_sMoldPartFile, True)
For Each blockref As Object In m_ssetProfiles
'now read the profiles, figure out the cut lengths, write to textfile opened
above
GetFormCutListFromProfileBlock(blockref, oCSVFile)
End If
Next
'after looping and writing to file, close it
If Not oCSVFile Is Nothing Then
oCSVFile.Close()
End If
End Sub
'def
Sub GetFormCutListFromProfileBlock(ByVal blockref As AcadBlockReference,
ByVal oCSVFile As System.IO.StreamWriter)
''calculate stuff then write to file
Dim CommaDelimLine As String = sQty & "," & _
sMoldPartName & "," & _
sWidthLiner & "," & _
sLengthLiner & "," & _
m_sMatlLinername & "," & _
m_ssheetwidth & "," & _
m_ssheetthick & "," & _
m_shasgrain & "," & _
sLabeltest
'send composed line to file
AppendToCsvFile2(CommaDelimLine, oCSVFile)