VS:RecalculateWS

From Vectorworks Developer
Jump to: navigation, search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Recalculates all formulas for the referenced worksheet.
PROCEDURE RecalculateWS(
worksheet  :HANDLE);
def vs.RecalculateWS(worksheet):
    return None

Parameters

worksheet HANDLE Handle to worksheet.

Remarks

This does not update the screen, so you should also do:
ResetObject(worksheet);
WSImage := GetWSImage(worksheet);
IF WSImage <> NIL THEN ResetObject(WSImage);

Example

VectorScript

PROCEDURE WSrecalc;
{ (c) Petri Sakkinen 2008, except the key part which is (c) Victor via VSFR }

VAR 
  i, n : INTEGER;
  objName : STRING;
  foundObject : HANDLE;
  OK : BOOLEAN; 

FUNCTION DoIt (h : HANDLE) : BOOLEAN;
BEGIN
  RECALCULATEWS(h);
  RESETOBJECT(h);              { these two lines   }
  RESETOBJECT(GETWSIMAGE(h));  { are the key part! }
END;

BEGIN
  n := NAMENUM; 
  FOR i := 1 TO n DO BEGIN
    foundObject := GETOBJECT(NAMELIST(i));
    IF GETTYPE(foundObject) = 18 THEN ok := DoIt(foundObject);
  END; 
END;
RUN(WSrecalc);

Python


Version

Availability: from VectorWorks9.0
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox