Bri Guy

Changing Delete Function to Split

Discussion created by Bri Guy on Feb 12, 2020
Latest reply on Feb 18, 2020 by Bri Guy

Hello I currently have a macro to delete the rows on a BOM that do not have YES in a custom property of choice. It would be better if it split at that point and then moved it. This would be a huge help. 


Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swSelMgr As SldWorks.SelectionMgr
Dim swBOMTable As SldWorks.BomTableAnnotation
Dim i As Long

Sub Main()

Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swSelMgr = swModel.SelectionManager
Set swBOMTable = swSelMgr.GetSelectedObject6(1, 0)


For i = swBOMTable.RowCount - 1 To 2 Step -1
If UCase(swBOMTable.DisplayedText2(i, 6, False)) <> "" Then 'Change 3 to column number where you want to check the YES/NO
swBOMTable.DeleteRow2 i, False   'Assuming another variable must be made and swap Deleterow2 with Split? 
End If
Next i
End Sub