Hide/Show a BOM Column...

Does anyone know if it's possible to hide/show a column in a bill of material using the API?SolidworksApi macros
Answers 13
SF
SF 2009-08-04 Best Answer
It does not look like it. I did find a TableAnnotation::RowHidden to hide a row.
SF
SF 2009-08-04

Yeah.. that's all I've seen too.

Another alternative would be to insert a row and delete it maybe... but I couldn't figure out how to set a column so that it's value was based on an equation such as:  PRP:"Weight"

SF
SF 2009-08-04
If this is the last column, you can split the table through the API and I think you can move the column off the drawing sheet.
SF
SF 2009-08-04
It's the nex to to last column actually...
JC
JC 2009-08-04

you need to have to templates

Dim bom As String = "C:\Program Files\SolidWorks\lang\English\bomtemp.xls"

Dim bomCustom As String = "C:\Program Files\SolidWorks\lang\English\bomtemp_custom.xls"

   Dim swBOM As SldWorks.BomTable

public sub addBOM()

     swBOM = swView.InsertBomTable(bom, 10.5, 0.01, longstatus)

end sub

public sub changeBOM(temp)

     swBOM.Detach()

      swBOM = swView.InsertBomTable(temp, 10.5, 0.01, longstatus)

end sub

call addBOM on load of macro which will add the BOM

then Call ChangeBOM(bom) or ChangeBOM(bomCustom )

IK
IK 2009-08-04

and if you remove it?

    boolstatus = theTableAnnotation.DeleteColumn(theTableAnnotation.ColumnCount - 2)

SF
SF 2009-08-04
I would need to be able to insert it and set it's custom property and then delete it with this method.
SF
SF 2009-08-04
This looks like it'll work for what I'm needing... although I do think it's ridiculous that there isn't a way to show/hide a column in a BOM.  Hopefully SolidWorks will start giving more API BOM controls in the very near future.
JC
JC 2009-08-04

suggest it

at https://customerportal.solidworks.com/ under Enhancement Requests

SF
SF 2011-11-01

What does API stand for?  Thanks!

WM
WM 2011-11-01

Application Programming Interface

SF
SF 2011-11-01

Thanks.  Do you have 2 profiles?

WM
WM 2011-11-01

Yes, combining the two was not worth the effort when my email changed with the change of companies.