Python scripting - Event operators

CENPyOlpEvent_EventComputeOperator

 

The object of the CENPyOlpEvent_EventComputeOperator class is passed to the PostCompute callback as a parameter.

It can be used to obtain the required operators within the scope of the PostCompute callback in the %EVENT_NAME%.py script file.

 

[Example]

File: Samples\JenoptikPluginUpdated\Plugin\TechnologyPackages\LaserCuttingTechnology\Jenoptik\LaserEvent.py

 

def PostCompute(eco):

 

 

Methods

 

GetAttribGetter(): CENPyOlpAttribGetter

 

o

return

Object of CENPyOlpAttribGetter class

 

[Example]

   attribGetter = eco.GetAttribGetter()

 


 

GetLoggerOperator(): CENPyOlpLogOperator

 

o

return

Object of CENPyOlpLogOperator class.

 

[Example]

   logger = eco.GetLoggerOperator()

 


 

CreateMatrix(): CENPyOlpMatrix

 

o

return

Object of CENPyOlpMatrix class

 

[Example]

   mat = eco.CreateMatrix()

 


 

CreatePoint(x: float, y: float, z: float): CENPyOlpPoint

 

o

x

x coordinate in meters

 

o

y

y coordinate in meters

 

o

z

z coordinate in meters

 

o

return

Object of CENPyOlpPoint class

 

[Example]

   point = eco.CreatePoint(0.0, 0.5, 1.0)

 


 

CreateVector(x: float, y: float, z: float): CENPyOlpVector

 

o

x

x coordinate in meters

 

o

y

y coordinate in meters

 

o

z

z coordinate in meters

 

o

return

Object of CENPyOlpVector class

 

[Example]

   vector = eco.CreateVector(1.0, 0.0, 1.0)

 


 

GetRefTpElement(): CENPyOlpTpElement

 

o

return

Object of CENPyOlpTpElement class

 

Returns the reference toolpath element of the event

 

[Example]

   refTP = eco.GetRefTpElement()

 


 

MoveLin(target: CENPyOlpMatrix): CENPyOlpTpElement

 

o

target

Target matrix as object of CENPyOlpMatrix class

 

o

return

linear toolpath element. Object of CENPyOlpTpElement class

 

Adds a move lin element at the end 

 

[Example]

   tp = eco.MoveLin(destinationMat)

 


 

MoveCir(target: CENPyOlpMatrix, via: CENPyOlpMatrix): CENPyOlpTpElement

 

o

target

Target matrix as object of CENPyOlpMatrix class

 

o

via

"via" point as object of CENPyOlpMatrix class

 

o

return

Object of CENPyOlpTpElement class

 

Adds a circular move element at the end 

 

[Example]

   tp = eco.MoveCir(destinationMat, viaMat)

 


 

MoveCir(target: CENPyOlpMatrix, radius: float, direction: int): CENPyOlpTpElement

 

o

target

Target matrix as object of CENPyOlpMatrix class

 

o

radius

circle radius

 

o

direction

direction of circle ([-1] = clockwise  or [1] = counter clockwise)

 

o

return

Object of CENPyOlpTpElement class

 

Adds a circular move element at the end 

Uses vector tangent current toolpath element and vector current toolpath element to target toolpath element for plane of circle 

if vectors are co-linear use target as endpoint and middle of current to target as via point

 

[Example]

   tp = eco.MoveCir(destinationMat, 0.1, -1)

 


 

MoveCir(angle: float, radius: float): CENPyOlpTpElement

 

o

angle

opening angle of circle

 

o

radius

circle radius

 

o

return

Object of CENPyOlpTpElement class

 

Adds a circular move element at the end 

 

[Example]

   tp = eco.MoveCir(angle, radius)

 


 

MoveTangentCir(start: CENPyOlpMatrix, end: CENPyOlpMatrix, tangentTo: UseTangentOf): CENPyOlpTpElement

 

o

start

start point matrix of the move circular

 

o

end

end point matrix of the move circ

 

o

tangentTo

tangent to start or end : UseTangentOf::Start, UseTangentOf::End

 

o

return

Object of CENPyOlpTpElement class

 

Adds a circular move element tangential to a matrix

 

[Example]

   tp = eco.MoveTangentCir(startMat, endMat, USETANGENTOFSTART)

 


 

MovePTP(target: CENPyOlpMatrix): CENPyOlpTpElement

 

o

target

Target matrix of the move. Object of CENPyOlpMatrix class

 

o

return

PTP toolpath element added

 

Adds a point to point move element at the end

 

[Example]

   tp = eco.MovePTP(destinationMat)

 


 

 

SkipPath(length: float, includeStartAndEnd: bool)

 

o

length

The lenght to be skipped

 

o

includeStartAndEnd

Flag determining whether or not to include start and end point

 

Skips the toolpath elements for a given length

 

[Example]

   eco.SkipPath(10, False)

 


 

GetInitialPathMatrixByLength(length: float): CENPyOlpMatrix

 

o

length

Length of the path after which the element should appear. Units: meters.

 

o

return

Matrix at given length, outputs warning "CENPyOlpMatrix::CENPyOlpMatrix, argument is nullptr" if could not be calculated

 

Gets initial path matrix of toolpath element at given length

Remark: When at given length no toolpath element exists temporary one is created (deleted after usage immediately)

 

[Example]

   initMat = eco.GetToolpathElementByLength(0.1)

 


 

GetRefToolpathElementPosition(): CENPyOlpMatrix

 

o

return

The element at given length, nullptr if there is none

 

Determines the base frame position of the reference element of an event. 

 

[Example]

   posMat = eco.GetRefToolpathElementPosition()

 


 

GetController(): CENPyOlpController

 

o

return

The Controller object

 

Returns current Controller

 

[Example]

   controller = eco.GetController()

 


 

GetEventOperator(): CENPyOlpEventOperator

 

o

return

Object of CENPyOlpEventOperator class.

 

[Example]

def PostCompute(eco):

   eventOperator = eco.GetEventOperator()

 


 

SetTechnologyRequestId(element: CENPyOlpTpElement, techRequestId: int):

 

o

element

Object of CENPyOlpTpElement class.

 

o

techRequestId

Integer value to identify this toolpath element in event rules.

 

[Example]

def PostCompute(eco):

   eventOperator = eco.SetTechnologyRequestId(CENPyOlpTpElement, INT_ID)

 


 

GetCurrentToolFrameIndex(): int

 

 

o

return

Returns the index of the current tool frame for a specific toolpath element, defined on the operation level, or -1 if active tool is not set

 

GetCurrentToolframeIndex() with lowercase "frame" can also be used.

 

[Example]

currentToolFrameIndex = eco.GetCurrentToolFrameIndex()

 

 


 

GetCurrentBaseFrameIndex(): int

 

 

o

return

Returns the index of the current base frame for a specific toolpath element, defined on the operation level, or -1 if active tool is not set

 

GetCurrentBaseframeIndex() with lowercase "frame" can also be used.

 

[Example]

currentBaseFrameIndex = eco.GetCurrentBaseFrameIndex()

 

 


 

GetCurrentToolFrameMatrix(): CENPyOlpMatrix

 

 

o

return

Returns the matrix of the current tool frame for a specific toolpath element, defined on the operation level

 

GetCurrentToolframeMatrix() with lowercase "frame" can also be used.

 

[Example]

currentToolFrameMatrix = eco.GetCurrentToolFrameMatrix()

 

 


 

GetCurrentBaseFrameMatrix(): CENPyOlpMatrix

 

 

o

return

Returns the matrix of the current base frame for a specific toolpath element, defined on the operation level

 

GetCurrentBaseframeMatrix() with lowercase "frame" can also be used.

 

[Example]

currentBaseFrameMatrix = eco.GetCurrentBaseFrameMatrix()

 


 

IsEventCreatedAutomatically(): bool

 

o

return

True if the Event was created by a rule or by another Event, False if inserted manually.

 

Get if the reference event was created by a rule, another event, or inserted manually.

 

[Example]

logging.LogInfo(f"Current event was created automatically = {eco.IsEventCreatedAutomatically()}.")

 


 


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