Page 1 of 1

Set text format of revision table to default

Posted: Fri Sep 30, 2022 12:47 pm
by berg_lauritz
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

Code: Select all

boolstatus = swtable.SetTextFormat(False, swTextFormat)
Any ideas?


@Stefan Sterk , @gupta9665

Re: Set text format of revision table to default

Posted: Fri Sep 30, 2022 1:26 pm
by AlexB
This is the only place I know off the top of my head to modify those values.

https://help.solidworks.com/2016/englis ... able2.html

Re: Set text format of revision table to default

Posted: Mon Oct 03, 2022 10:22 am
by berg_lauritz
AlexB wrote: Fri Sep 30, 2022 1:26 pm This is the only place I know off the top of my head to modify those values.

https://help.solidworks.com/2016/englis ... able2.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.

Re: Set text format of revision table to default

Posted: Mon Oct 03, 2022 10:31 am
by AlexB
berg_lauritz wrote: Mon Oct 03, 2022 10:22 am 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.

Re: Set text format of revision table to default

Posted: Mon Oct 03, 2022 11:25 am
by berg_lauritz
AlexB wrote: Mon Oct 03, 2022 10:31 am 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:

Code: Select all

'            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
  • Code: Select all

    BOMfeat.FollowAssemblyOrder2 = True
    The checkbox to follow the assembly order is accessed through the feature
  • Code: Select all

    bomSetting = swModelDocExt.GetUserPreferenceString(swUserPreferenceStringValue_e.swDetailingLayer, swUserPreferenceOption_e.swDetailingBillOfMaterial)
                swAnn.Layer = bomSetting
    The layer is accessed through the annotation
  • Code: Select all

    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...