Python scripting - Event rule operators

CENPyOlpEventRuleOperator

 

The object of the CENPyOlpEventRuleOperator class is passed to the PostExecute callback as a parameter.

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

 

[Example]

 

def PostExecute(reo):

    tpes = reo.FindTpElementsByType(EVENTPROCESS_INPROCESS)

    for x in tpes:

        reo.AddTpe(x)

 

 

Methods

 

GetAttribGetter(): CENPyOlpAttribGetter

 

o

return

Object of CENPyOlpAttribGetter class

 

[Example]

   attribGetter = reo.GetAttribGetter()

 


 

GetAttribSetter(): CENPyOlpAttribSetter

 

o

return

Object of CENPyOlpAttribSetter class

 

[Example]

   attribSetter = reo.GetAttribSetter()

 


 

GetLoggerOperator(): CENPyOlpLogOperator

 

o

return

Object of CENPyOlpLogOperator class.

 

[Example]

   logger = reo.GetLoggerOperator()

 


 

GetCurrentProcessGeometryOperator(): CENPyOlpProcessGeometryOperator

 

o

return

Object of CENPyOlpProcessGeometryOperator class

 

[Example]

   currentPGoperator = reo.GetCurrentProcessGeometryOperator()

 


 

FindTpElementsByType(eventProcessType: EventProcessType): list of CENPyOlpTpElement  objects

 

o

eventProcessType

EventProcessType of event to attach

 

o

return

list of CENPyOlpTpElement  objects found

 

This method does not return elements of given EventProcessType but it returns

 those elements where it is possible to attach events of given EventProcessType

 

[Example]

    tpes = reo.FindTpElementsByType(EVENTPROCESS_INPROCESS)

 


 

FindTpElementsByPositions(positions: list, tolerance: float): list of CENPyOlpTpElement  objects

 

o

positions

List  of positions, each position in [0.0, 1.0]

 

o

tolerance

Given length tolerance

 

o

return

list of CENPyOlpTpElement  objects found

 

Method returns olp toolpath elements fitting to positions in given array by taking given tolerance into account

 

[Example]    

   list = [0.25, 0.75]

   tpesPos = reo.FindTpElementsByPositions(list, 0.1)

   for x in tpes:

       reo.AddTpe(x)

       myMat = x.GetMatrix()

       logOperator.LogDebug(str(myMat.GetPosition().GetXYZ()))

       logOperator.LogDebug(str(myMat.GetRotation()))

 


 

FindTpElementsById(requestId: int): list of CENPyOlpTpElement  objects

 

o

requestId

Given request id - originally passed through by technology

 

o

return

list of CENPyOlpTpElement  objects found

 

Method returns olp toolpath elements fitting given request id

 

[Example]

    tpes = reo.FindTpElementsByType(INT_ID)

 


 

FindTpeByTechRequestId(techRequestId: int): list of CENPyOlpTpElement  objects

 

o

requestId

Given technology request id - originally passed through by technology

 

o

return

list of CENPyOlpTpElement  objects found

 

Method returns olp toolpath elements fitting given technology request id

 

[Example]

    tpes = reo.FindTpeByTechRequestId(INT_ID)

 


 

SetActiveEvent(index: int)

 

o

index

index of event to use (should be added to current rule see CENPyOlpWM_RuleInitOperator::AddPyEvent)

 

Set the active event by the list index.

 

 [Example]

   reo.SetActiveEvent(1)

 


 

AddTpe( tpe: CENPyOlpTpElement)

 

o

tpe

Object of CENPyOlpTpElement class

 

Adds event to toolpath element

 

[Example]

   reo.AddTpe(x)

 


 

 

 


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