I am looking for a VBA macro function or method that accomplishes the same thing as right clicking on a BOM Table cell and pressing "Restore Original Value". I have searched the Solidworks API help, but can't find anything like it.
TIA
I am looking for a VBA macro function or method that accomplishes the same thing as right clicking on a BOM Table cell and pressing "Restore Original Value". I have searched the Solidworks API help, but can't find anything like it.
TIA
Hello,
You just need to set the text of the cell to "Empty".
Example for the cell on row #2 and column #2:
Option Explicit
Sub main()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swDraw As SldWorks.DrawingDoc
Dim swView As SldWorks.View
Dim swTable As SldWorks.TableAnnotation
Dim CellRowNum As Long
Dim CellColNum As Long
CellRowNum = 1
CellColNum = 1
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swDraw = swModel
Set swView = swDraw.GetFirstView
Set swTable = swView.GetFirstTableAnnotation
While Not swTable Is Nothing
If swTable.Type = swTableAnnotationType_e.swTableAnnotation_BillOfMaterials Then
swTable.Text(CellRowNum, CellColNum) = Empty
End If
Set swTable = swTable.GetNext
Wend
End Sub
Hello,
You just need to set the text of the cell to "Empty".
Example for the cell on row #2 and column #2: