Python scripting - Workmethod callbacks

PostWmSyncPgAttributes

 

The callback PostWmSyncPgAttributes(CENPyOlpWM_SyncPgAttribOperator) will be called only when an operation is computed but not when it is recomputed.

 

It can be used to:

- get attribute values

- set attribute values

- get attribute values of events

- set attribute values of events

- access ProcessGeometryOperator

- output to the log

 

The callback is defined in the %WORKMETHOD_NAME%.py file that is located in the scripts folder of the plugin.

 

PostWmSyncPgAttributes

 

[Example]

 

def PostWmSyncPgAttributes(operator):

    attribGetter = operator.GetAttribGetter()

    attribSetter = operator.GetAttribSetter()

    processGeometryOperator = operator.GetCurrentProcessGeometryOperator()

    geometryName = processGeometryOperator.GetProcessGeometryName()

    isRegshape = processGeometryOperator.IsRegshape()

    matrix = processGeometryOperator.GetRegshapeCenter()

    regshapeLength = processGeometryOperator.GetRegshapeLength()

    regshapeHeight = processGeometryOperator.GetRegshapeHeight()

    regshapeRadius = processGeometryOperator.GetRegshapeRadius()

    regshapeCornerRadius = processGeometryOperator.GetRegshapeCornerRadius()

    geoType = processGeometryOperator.GetGeoType()    

    regshapeType = processGeometryOperator.GetRegshapeType()

    if regshapeType == REGSHAPE_CIRCLE:        

        circleEventAttribGetter = operator.GetEventAttribGetter('CIRCLE')

        circleEventAttribSetter = operator.GetEventAttribSetter('CIRCLE')

        circRad = circleEventAttribGetter.GetDouble('Radius')

 

    logger = operator.GetLoggerOperator()

    logger.LogDebug('PostWmSyncPgAttributes OK.')    

 


PostWmSyncPgAttributes_Ex

 


Previous
Page précédente
Chapter
Page principale du chapitre
Next
Page suivante