VS:vsoStateGetLayrChng

From Vectorworks Developer
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

Description

Used to determine if the layer scale have changed. See VS:Parametric State Notifications#vsoStateGetLayrChng

This function should be called during the parametric reset event: 3: {kParametricRecalculate}

FUNCTION vsoStateGetLayrChng(
hObj  : HANDLE;
VAR outOldScale  : REAL;
VAR outNewScale  : REAL;
VAR outScaleText  : BOOLEAN) : BOOLEAN;
def vs.vsoStateGetLayrChng(hObj):
    return (BOOLEAN, outOldScale, outNewScale, outScaleText)

Parameters

hObj HANDLE Handle to the parametric object. Obtained by call to VS:GetCustomObjectInfo
outOldScale REAL Output parameter. Old layer scale.
outNewScale REAL Output parameter. New layer scale.
outScaleText BOOLEAN Output parameter. Does the new scale affect texts.

Example

VectorScript

BEGIN
  result := GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand);
  vsoGetEventInfo(theEvent, message );

  CASE theEvent OF
    5: {kObjOnInitXProperties}
    BEGIN
      {enable eventing for this plug-in}
      SetPrefInt( 590, 1 ); {varParametricEnableStateEventing, kParametricStateEvent_ResetStatesEvent}
      result := SetObjPropVS(18, TRUE); {kObjXPropAcceptStates}
      result := SetObjPropVS( 2, TRUE ); {kObjXPropHasLayerScaleDeps}
    END;	

    44: {kObjOnAddState}
    BEGIN
      message := vsoStateAddCurrent( objectHand, message );
    END;

    3: {kParametricRecalculate}
    BEGIN
      MoveTo( 5mm, 8mm );
      CreateText( 'State events received after the last kParametricRecalculate:' );

      IF vsoStateGetLayrChng( objectHand, oldScale, newScale, scaleText ) THEN BEGIN
        MoveTo( 0,-60mm );
        CreateText( Concat( 'Layer changed! oldScale=', oldScale, ' newScale=', newScale, ' scaleText=', scaleText ) );
      END;
    END;

Python


Version

Availability: from Vectorworks 2009

This is drop-in function.

See Also

VS:Parametric State Notifications | VS:vsoStateAddCurrent

VS:vsoStateGetPos | VS:vsoStateGetRot | VS:vsoStateGetParamChng | VS:vsoStateGetObjChng | VS:vsoStateGetLayrChng | VS:vsoStateGetExitGroup | VS:vsoStateGetNameChng

[[VS:Parametric State Notifications]] | [[VS:vsoStateAddCurrent]] [[VS:vsoStateGetPos]] | [[VS:vsoStateGetRot]] | [[VS:vsoStateGetParamChng]] | [[VS:vsoStateGetObjChng]] | [[VS:vsoStateGetLayrChng]] | [[VS:vsoStateGetExitGroup]] | [[VS:vsoStateGetNameChng]]