Set text format of revision table to default

Programming and macros
berg_lauritz
Posts: 423
Joined: Tue Mar 09, 2021 10:11 am
Answers: 6
x 441
x 235

Set text format of revision table to default

Unread post 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
User avatar
AlexB
Posts: 447
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 24
x 243
x 397

Re: Set text format of revision table to default

Unread post 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
berg_lauritz
Posts: 423
Joined: Tue Mar 09, 2021 10:11 am
Answers: 6
x 441
x 235

Re: Set text format of revision table to default

Unread post 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.
User avatar
AlexB
Posts: 447
Joined: Thu Mar 18, 2021 1:38 pm
Answers: 24
x 243
x 397

Re: Set text format of revision table to default

Unread post 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.
berg_lauritz
Posts: 423
Joined: Tue Mar 09, 2021 10:11 am
Answers: 6
x 441
x 235

Re: Set text format of revision table to default

Unread post 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...
Post Reply