I found something, and I can store a full "stamp" of a BOM in a variable with this method:
- I can write the table's contentt to a template file with this function: 2013 SOLIDWORKS API Help - SaveAsText Method (ITableAnnotation)
- I read back this template file, and store it's text in a variable
- delete template file
Now I can compare anytime if a BOM changed or not.
The big question, can I directly send the content to a variable instead of a file?
The SaveAsText method needs an input as FileName (full path), can I somehow redirect it to a variable?
I didn't find a solution to redirect SaveAsText uotput to variable, so I use filewrite/read method like in code below.
- readFileByLine is my function what gives back List(Of String) object based on reading a text file line by line
- tablePrevious is a Public String object
Dim result As Boolean = False
Dim fileName As String = "C:\tempbomtocheck.txt"
Dim saveAsResult = myTable.SaveAsText(fileName, ";")
Dim currentTable As String = String.Join(vbNewLine, readFileByLine(fileName))
If tablePrevious IsNot Nothing Then
result = (tablePrevious = currentTable)
tablePrevious = currentTable