Does anyone know if it's possible to hide/show a column in a bill of material using the API?SolidworksApi macros
Answers13
SF
SF2009-08-04Best Answer
It does not look like it. I did find a TableAnnotation::RowHidden to hide a row.
SF
SF2009-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
SF2009-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
SF2009-08-04
It's the nex to to last column actually...
JC
JC2009-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"
I would need to be able to insert it and set it's custom property and then delete it with this method.
SF
SF2009-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.
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"
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 )
and if you remove it?
boolstatus = theTableAnnotation.DeleteColumn(theTableAnnotation.ColumnCount - 2)
suggest it
at https://customerportal.solidworks.com/ under Enhancement Requests
What does API stand for? Thanks!
Application Programming Interface
Thanks. Do you have 2 profiles?
Yes, combining the two was not worth the effort when my email changed with the change of companies.