Set text format of revision table to default

I am trying to access some options of a revision table after it is placed already:

  • Revision Symbol & checkbox
  • Auto Update Zone Cells
  • set table to default font

2022-09-30 11_39_59-Window.png
2022-09-30 11_40_28-Window.png
I cannot figure out how to do it.

Regarding the default font I also found this thread about it but even when first getting the default font with GetUserPreferenceTextFormat it won’t change the format with

boolstatus = swtable.SetTextFormat(False, swTextFormat)

Any ideas?


Stefan Sterk , gupta9665

This is the only place I know off the top of my head to modify those values.

https://help.solidworks.com/2016/english/api/sldworksapi/SolidWorks.Interop.sldworks~SolidWorks.Interop.sldworks.ISheet~InsertRevisionTable2.html

That is only possible if you insert a table though.

I was thinking that I might have to read out the default values & change the feature/annotation/tableannotation to the read-out value.
But whatever I tried - it did not seem to work.

Yeah, I guess I should have been a bit more descriptive. I don’t know of any way other than when inserting a new table to do this. I’ve looked through quite a bit of the documentation and it’s less than helpful.

This is i.e. how I set the line weights/layer for the BOM table:

'            Get & set table layer to standard for tables
            BOMfeat.FollowAssemblyOrder2 = True
            bomSetting = swModelDocExt.GetUserPreferenceString(swUserPreferenceStringValue_e.swDetailingLayer, swUserPreferenceOption_e.swDetailingBillOfMaterial)
            swAnn.Layer = bomSetting
'            get & set standard table lineweight
            cfgInteger = swModelDocExt.GetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swDetailingBillOfMaterialBorderLineWeight, swUserPreferenceOption_e.swDetailingNoOptionSpecified)
            TableAnn.BorderLineWeight = cfgInteger
            cfgInteger = swModelDocExt.GetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swDetailingBillOfMaterialGridLineWeight, swUserPreferenceOption_e.swDetailingNoOptionSpecified)
            TableAnn.GridLineWeight = cfgInteger



BOMfeat.FollowAssemblyOrder2 = True


The checkbox to follow the assembly order is accessed through the feature
* ```text
bomSetting = swModelDocExt.GetUserPreferenceString(swUserPreferenceStringValue_e.swDetailingLayer, swUserPreferenceOption_e.swDetailingBillOfMaterial)
            swAnn.Layer = bomSetting

The layer is accessed through the annotation

cfgInteger = swModelDocExt.GetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swDetailingBillOfMaterialBorderLineWeight, swUserPreferenceOption_e.swDetailingNoOptionSpecified)
TableAnn.BorderLineWeight = cfgInteger
cfgInteger = swModelDocExt.GetUserPreferenceInteger(swUserPreferenceIntegerValue_e.swDetailingBillOfMaterialGridLineWeight, swUserPreferenceOption_e.swDetailingNoOptionSpecified)
TableAnn.GridLineWeight = cfgInteger


The line weights are accessed through the table annotation

It's a super confusing system...