VS:vsoStateGetExitGroup

From Vectorworks Developer
Jump to: navigation, search

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

Description

Used to determine if exit from group have happened. See VS:Parametric State Notifications#vsoStateGetExitGroup

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

Group types:

  • kObjXPropEditGroupDefault = 0
  • kObjXPropEditGroupProfile = 1
  • kObjXPropEditGroupPath = 2
  • kObjXPropEditGroupCustom = 3
FUNCTION vsoStateGetExitGroup(
hObj  : HANDLE;
VAR outGrpType  : LONGINT) : BOOLEAN;
def vs.vsoStateGetExitGroup(hObj):
    return (BOOLEAN, outGrpType)

Parameters

hObj HANDLE Handle to the parametric object. Obtained by call to VS:GetCustomObjectInfo
outGrpType LONGINT Output parameter. Return the group type.

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}
    END;	

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

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

      IF vsoStateGetExitGroup( objectHand, grpType ) THEN BEGIN
        MoveTo( 0,-40mm );
        IF grpType = 0 THEN       CreateText( 'Object exited from edit group! Exited from: Default Group!' )
        ELSE IF grpType = 1 THEN  CreateText( 'Object exited from edit group! Exited from: Profile Group!' )
        ELSE IF grpType = 2 THEN  CreateText( 'Object exited from edit group! Exited from: Path Group!' )
        ELSE IF grpType = 3 THEN  CreateText( 'Object exited from edit group! Exited from: Custom Group!' )
        ELSE                      CreateText( 'Object exited from edit group! Exited from: Uknown Group!' );
      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]]
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox