Python scripting - Workmethod operators

CENPyOlpWM_SyncPgAttribOperator

Previous  Chapter  Next

 

The object of the CENPyOlpWM_SyncPgAttribOperator class is passed to the PostWmSyncPgAttributes callback as a parameter.

It can be used to obtain the required operators within the scope of the PostWmSyncPgAttributes callback in the %WORK_METHOD%.py script file, located in the folder of the plugin.

 

[Example]

 

def PostWmSyncPgAttributes(syncPgAttribOperator):

   pass

 

Methods

 

GetAttribGetter(): CENPyOlpAttribGetter

 

o

return

Object of CENPyOlpAttribGetter class

 

[Example]

   attribGetter = syncPgAttribOperator.GetAttribGetter()

 


 

GetAttribSetter(): CENPyOlpAttribSetter

 

o

return

Object of CENPyOlpAttribSetter class

 

[Example]

   attribSetter = syncPgAttribOperator.GetAttribSetter()

 


 

GetEventAttribGetter(eventName: string): CENPyOlpAttribGetter

 

o

eventName

Name of the event. Kernel defined event name may be used

 

o

return

Object of CENPyOlpAttribGetter class

 

[Example]

   eventAttribGetter = syncPgAttribOperator.GetEventAttribGetter('CIRCLE')

 


 

GetEventAttribSetter(eventName: string): CENPyOlpAttribSetter

 

oeventName

Name of the event. Kernel defined event name may be used

 

o

return

Object of CENPyOlpAttribSetter class

 

[Example]

   eventAttribSetter = syncPgAttribOperator.GetEventAttribSetter('CIRCLE')

 


 

GetLoggerOperator(): CENPyOlpLogOperator

 

o

return

Object of CENPyOlpLogOperator class

 

[Example]

   logOperator = syncPgAttribOperator.GetLoggerOperator()

 


 

GetCurrentProcessGeometryOperator(): CENPyOlpProcessGeometryOperator

 

o

return

Object of CENPyOlpProcessGeometryOperator class

 

[Example]

    processGeometryOperator = syncPgAttribOperator.GetCurrentProcessGeometryOperator()

 


 

GetCurrentToolFrameIndex(): int

 

o

return

Returns the index of the current tool frame for the parent operation, or -1 if tool index is not set

 

Get the current tool frame index of the parent operation.

 

[Example]

toolIndex = Operator.GetCurrentToolFrameIndex()

 


 

GetCurrentBaseFrameIndex(): int

 

o

return

Returns the index of the current base frame for the parent operation, or -1 if base index is not set

 

Get the current base frame index of the parent operation.

 

[Example]

baseIndex = Operator.GetCurrentBaseFrameIndex()

 


 

·

GetCurrentToolFrameMatrix(): CENPyOlpMatrix

 

o

return

Returns the matrix of the current tool frame for the parent operation

 

Get the current tool frame matrix of the parent operation.

 

[Example]

  toolFrameMatrix = Operator.GetCurrentToolFrameMatrix()

  if toolFrameMatrix.IsValid():

     logging.LogInfo("toolFrameMatrix is valid!")

     logging.LogInfo("Tool frame matrix position:" + str(toolMatrix.GetPosition().GetXYZ()))

     logging.LogInfo("Tool frame matrix rotation:" + str(toolMatrix.GetRotation()))

  else:

     logging.LogInfo("toolFrameMatrix is not valid!")

 


 

·

GetCurrentBaseFrameMatrix(): CENPyOlpMatrix

 

o

return

Returns the matrix of the active base frame for the parent operation

 

Get the current base frame matrix of the parent operation.

 

[Example]

  baseFrameMatrix = Operator.GetCurrentBaseFrameMatrix()

  if baseFrameMatrix.IsValid():

     logging.LogInfo("baseFrameMatrix is valid!")

     logging.LogInfo("Base frame matrix position:" + str(baseMatrix.GetPosition().GetXYZ()))

     logging.LogInfo("Base frame matrix rotation:" + str(baseMatrix.GetRotation()))

  else:

     logging.LogInfo("baseFrameMatrix is not valid!")

 


 

GetController(): CENPyOlpController

 

o

return

Object of CENPyOlpController class

 

This method returns the parent controller.

 

[Example]

   controller = operator.GetController()

 


 

 


Previous
Previous page
Chapter
Chapter page
Next
Next page