Skip to content

Latest commit

 

History

History
83 lines (64 loc) · 1.9 KB

GetWSAutoRecalcState.md

File metadata and controls

83 lines (64 loc) · 1.9 KB

GetWSAutoRecalcState

Description

Gets the AutoRecalc state for the specified worksheet.

When the AutoRecalc flag is on for a worksheet, it automatically recalculates every time a cell is edited.

In order to improve speed when editing mutiple cells one after the other or in a loop, it is highly recommended to turn this flag off prior to the edits and restore it, then recalculate the worksheet when all the edits are completed.

FUNCTION GetWSAutoRecalcState(worksheet : HANDLE): BOOLEAN;
def vs.GetWSAutoRecalcState(worksheet):
    return BOOLEAN

Parameters

Name Type Description
worksheet HANDLE Handle to worksheet.

Examples

VectorScript

{Save the current AutoRecalc state}
state := GetWSAutoRecalcState(h);

{Turn off worksheet Auto Recalculation}
SetWSAutoRecalcState(h,false);

{Execute worksheet edit operations ....}

{Restore AutoRecalc state}
SetWSAutoRecalcState(h, state);

{Recalculate the worksheet}
RecalculateWS(h);

Python

#{Save the current AutoRecalc state}
state = vs.GetWSAutoRecalcState(h)

#{Turn off worksheet Auto Recalculation}
vs.SetWSAutoRecalcState(h,False)

#{Execute worksheet edit operations ....}

#{Restore AutoRecalc state}
vs.SetWSAutoRecalcState(h, state)

#{Recalculate the worksheet}
vs.RecalculateWS(h)
resultOK := GetWSAutoRecalcState(worksheet);
import vs

# Gets the AutoRecalc state for the specified worksheet.
worksheet = vs.GetObject('MyWorksheet')  # handle to a worksheet

ok = vs.GetWSAutoRecalcState(worksheet)
if ok:
    vs.Message('GetWSAutoRecalcState succeeded')
else:
    vs.Message('GetWSAutoRecalcState failed')

See Also

VS Functions: SetWSAutoRecalcState | RecalculateWS

Version

Availability: from Vectorworks 14.0

Category