Python scripting - Common operators

CENPyOlpFrameChangedOperator

Previous  Chapter  Next

 

The object of the CENPyOlpFrameChangedOperator class is passed to the PostTechOnFrameChanged and the PostWmOnFrameChanged callbacks as a parameter.

It can be used to obtain the required operators within the scope of the PostTechOnFrameChanged callback in the %Technology%.py script file or within the scope of the PostWmOnFrameChanged callback in the %WORKMETHOD_NAME%.py file. If the PostTechOnFrameChanged or the PostWmOnFrameChanged callback returns True the operation recompute (ENTERSTATE_STARTWITHRULEEVENTS) will be triggered.

The default return value is False and does not need to be specified.

 

[Example]

 

def PostTechOnFrameChanged(Operator):

   return(False)

 

def PostWmOnFrameChanged(Operator):

   return(False)

 

 

Methods

 

GetAttribGetter()

 

o

return

Object of CENPyOlpAttribGetter class

 

This operator gives the possibility to find attribute and get its value.

 

[Example]

   attribGetter = Operator.GetAttribGetter()

 


 

GetAttribSetter()

 

o

return

Object of CENPyOlpAttribSetter class

 

This operator gives the possibility to change attribute value.

 

[Example]

   attribSetter = Operator.GetAttribSetter()

 


 

GetLoggerOperator()

 

o

return

Object of CENPyOlpLogOperator class

 

This operator gives the possibility to log issues resulting by user input.

 

[Example]

   logOperator = Operator.GetLoggerOperator()

 


 

GetController()

 

o

return

Object of CENPyOlpController class

 

This method returns the assigned controller.

 

[Example]

   controller = Operator.GetController()

 


 

GetCsvParserOperator(): CENPyOlpCsvParserOperator

 

o

return

Object of CENPyOlpCsvParserOperator class

This operator gives the possibility to work with CSV files. Please check the CENPyOlpCsvParserOperator class to see all available functions.

 

[Example]

   csvParser = Operator.GetCsvParserOperator() 

 


 

GetTechTabFolder(fileName: string, feedbackErrorWhenFileNotFound: bool): string

 

o

fileName

Name of the file with extension or relative path to the file

 

o

feedbackErrorWhenFileNotFound

Activates feedback if no file is found. It is optional parameter and is True by default

 

o

return

Full path to the specified file

This method returns the full path to the specified technology table file.

 

[Example]

   filePath = Operator.GetTechTabFolder("WeldingAttrib.csv")

 


 

GetChangedFrameName(): string

 

o

return

Name of the changed frame

This method returns the name of the changed frame.

 

[Example]

   changedFrameName = Operator.GetChangedFrameName()

 


 

GetChangedFrameIndex(): int

 

o

return

Index of the changed frame

This method returns the index of the changed frame.

 

[Example]

   changedFrameIndex = Operator.GetChangedFrameIndex()

 


 

GetChangedFrameType(): FrameType

 

o

return

Type of the changed frame

This method returns the type of the changed frame.

 

[Example]

   changedFrameType = Operator.GetChangedFrameType()

   if changedFrameType == FRAMETYPE_BASE:

      logging.LogInfo("Newly changed frame type: Base")

   if changedFrameType == FRAMETYPE_TOOL:

      logging.LogInfo("Newly changed frame type: Tool")

 


 

GetChangedFrameMatrix(): CENPyOlpMatrix

 

o

return

Object of CENPyOlpMatrix class

 This method returns the position matrix of the changed frame.

 

[Example]

   matrix = Operator.GetChangedFrameMatrix()

 


 

GetChangedFrameWorldMatrix(): CENPyOlpMatrix

 

o

return

Object of CENPyOlpMatrix class

 This method returns the position matrix of the changed frame relative to the world.

 

[Example]

   worldMatrix = Operator.GetChangedFrameWorldMatrix()

 


 


Previous
Previous page
Chapter
Chapter page
Next
Next page