Python scripting OLP - Objects

CENPyOlpTpElement

Previous  Chapter  Next

 

Methods

 

GetName(): string

 

 

o

return

Toolpath element name

 

Returns the name of the toolpath element.

 

[Example]

   tpElement = Operator.GetRefTpElement()

   tpeName = tpElement.GetName()

 


 

SetName(name: string):

 

 

o

name

New toolpath element name

 

Sets the new name of the toolpath element.

 

[Example]

   tpe = Operator.GetRefTpElement()

   tpe.SetName("NewName")

 


 

GetProcessType(): TpProcessType

 

o

return

Process type of the reference toolpath element

Returns the process type of the toolpath element.

 

[Example]   

   tpeProcessType = tpElement.GetProcessType()

 


 

GetMotionType(): MotionType

 

o

return

Motion type of the reference toolpath element

Returns the motion type of the toolpath element.

 

[Example]   

   tpeMotionType = tpElement.GetMotionType()

 


 

GetTargetType(): TargetType

 

o

return

Target type of the reference toolpath element

Returns the target type of the toolpath element.

 

[Example]   

   tpeTargetType = tpElement.GetTargetType()

 


 

GetConfigBehavior(): ConfigBehavior

 

o

return

Config behavior of the reference toolpath element

Returns the config behavior of the toolpath element.

 

[Example]   

   tpeConfigBehavior = tpElement.GetConfigBehavior()

 


 

GetConfigUserString(): string

 

o

return

Config user string of the reference toolpath element

Returns the config user string of the toolpath element.

 

[Example]   

   tpeConfigUserString = tpElement.GetConfigUserString()

 


 

GetTurnBehavior(): TurnBehavior

 

o

return

Turn behavior of the reference toolpath element

Returns the turn behavior of the toolpath element.

 

[Example]   

   tpeTurnBehavior = tpElement.GetTurnBehavior()

 


 

GetTurnUserString(): string

 

o

return

Turn user string of the reference toolpath element

Returns the turn user string of the underlying toolpath element.

 

[Example]   

   tpeTurnUserString = tpElement.GetTurnUserString()

 


 

GetCollisionStatus(includeViaPoint: bool): CollisionStatus

 

o

includeViaPoint

If True Via Point result is also included. Optional parameter. Default value is True.

 

o

return

Collision status of the reference toolpath element

Returns the collision status of the underlying toolpath element. Includes both cost evaluation and simulation results. Only COLLISIONSTATUS_NOCOLLISION or COLLISIONSTATUS_COLLISION results are possible.

 

[Example]   

   tpeCollisionStatus = tpElement.GetCollisionStatus()

 


   

GetSimulationCollisionStatus(): CollisionStatus

 

o

return

Collision status of the reference toolpath element

Returns the simulation collision status of the toolpath element.

The collision status of each toolpath element will only be available after running the simulation, otherwise, COLLISIONSTATUS_NOTCHECKED will be returned.

 

[Example]   

   tpeSimCollisionStatus = tpElement.GetSimulationCollisionStatus()

 


   

GetReachabilityStatus(): ReachabilityStatus

 

o

return

Reachability status of the reference toolpath element

Returns the reachability status of the toolpath element.

 

[Example]   

   tpeReachabilityStatus = tpe.GetReachabilityStatus()

 


 

GetSingularityStatus(): SingularityStatus

 

o

return

Singularity status of the reference toolpath element

Returns the singularity status of the toolpath element.

 

[Example]   

   tpeSingularityStatus = tpElement.GetSingularityStatus()

 


 

GetTeachFlags(): TeachFlags

 

o

return

Teach flags as a bitmask.

Gets the teach flags indicating the modifications made to the underlying toolpath element.

 

[Example]   

  for counter, tpElement in enumerate(tpes, 1):

     teachFlags = tpElement.GetTeachFlags()

     if teachFlags is TEACHFLAGS_NONE:

        logging.LogInfo(f"TPE <{counter}> is unmodified.")

     if teachFlags & TEACHFLAGS_NAME:

        logging.LogInfo(f"TPE <{counter}> name was changed.")

     if teachFlags & TEACHFLAGS_POSITION:

        logging.LogInfo(f"TPE <{counter}> position was changed.")

     if teachFlags & TEACHFLAGS_ROTATION:

        logging.LogInfo(f"TPE <{counter}> rotation was changed.")

     if teachFlags & TEACHFLAGS_JOINTS:

        logging.LogInfo(f"TPE <{counter}> joint values were changed.")

     if teachFlags & TEACHFLAGS_EXTERNALJOINTS:

        logging.LogInfo(f"TPE <{counter}> external joint values were changed.")

     if teachFlags & TEACHFLAGS_TARGETTYPE:

        logging.LogInfo(f"TPE <{counter}> target type was changed.")

     if teachFlags & TEACHFLAGS_MOTIONTYPE:

        logging.LogInfo(f"TPE <{counter}> motion tape was changed.")

     if teachFlags & TEACHFLAGS_TURNBEHAVIOUR:

        logging.LogInfo(f"TPE <{counter}> turn behavior were changed.")

     if teachFlags & TEACHFLAGS_CONFIGBEHAVIOR:

        logging.LogInfo(f"TPE <{counter}> config behavior values were changed.")

     if teachFlags & TEACHFLAGS_SINGULARITY:

        logging.LogInfo(f"TPE <{counter}> singularity was changed.")

     if teachFlags & TEACHFLAGS_VIAPOSITION:

        logging.LogInfo(f"TPE <{counter}> Via position was changed.")

 


 

 

GetMatrix(): CENPyOlpMatrix

 

o

return

Toolpath element matrix

Returns the matrix of the toolpath element relative to the internal (workpiece) base frame

 

[Example]

   currentTpElement = Operator.GetRefTpElement()

   tpMatrix = currentTpElement.GetMatrix()

 


 

GetInitialPathMatrix(): CENPyOlpMatrix

 

o

return

The initial path matrix

 

Returns the initial path matrix which has been saved after PathCompute but before AlignmentCompute state with respect to internal (workpiece) base frame

 

[Example]

   currentTpElement = Operator.GetRefTpElement()

   tpInitMatrix = currentTpElement.GetInitialPathMatrix()

 


 

GetInitialPathMatrixTranslatedInBaseFrame(x: float,y: float, z: float, index: int): CENPyOlpMatrix

 

o

x

x coordinate (float)

 

o

y

y coordinate (float)

 

o

z

z coordinate (float)

 

o

index

Base frame index (int)

 

o

return

Translated initial path matrix

 

Returns the initial path matrix moved with the given coordinates relative to the specified base frame.

 

[Example]

   currentTpElement = Operator.GetRefTpElement()

   currentBaseFrameIndex = Operator.GetCurrentBaseFrameIndex()
   translatedMatrix = currentTpElement.GetInitialPathMatrixTranslatedInBaseFrame(-0.1, 0.0, 0.0, currentBaseFrameIndex)

 


 

GetGlobalTransformedMatrix(): CENPyOlpMatrix

 

o

return

The global transformed path matrix in aligned state

 

Returns the path matrix which has been saved after global transformation compute in aligned state with respect to internal (workpiece) base frame

 

[Example]

   currentTpElement = Operator.GetRefTpElement()

   globalTransfMatrix = currentTpElement.GetGlobalTransformedMatrix()

 


 

GetGlobalTransformedMatrixUnaligned(): CENPyOlpMatrix

 

o

return

The global transformed path matrix in unaligned state

 

Returns the path matrix which has been saved after global transformation compute in unaligned state with respect to internal (workpiece) base frame

 

[Example]

   currentTpElement = Operator.GetRefTpElement()

   globalTransfUnalignedMatrix = currentTpElement.GetGlobalTransformedMatrixUnaligned()

 


 

GetInitialNeighbourMatrix(next: bool): CENPyOlpMatrix

 

o

return

The next/previous CENPyOlpMatrix

 

Returns the next or previous toolpath element matrix inside the current operation with respect to internal (workpiece) base frame. Default next value is True

 

[Example]

   currentTpElement = Operator.GetRefTpElement()

   initNextNeighbourMatrix = currentTpElement.GetInitialNeighbourMatrix()

 


 

GetMatrixToActiveBaseFrame(): CENPyOlpMatrix

 

o

return

Matrix relative to the active (output) base frame

 

Returns the matrix of the toolpath element relative to the active (output) base frame

 

[Example]

   currentTpElement = Operator.GetRefTpElement()

   activeBaseFrameMatrix = currentTpElement.GetMatrixToActiveBaseFrame()

   if activeBaseFrameMatrix.IsValid():

      logging.LogInfo("Active base frame matrix position: " + str(activeBaseFrameMatrix.GetPosition().GetXYZ()))

      logging.LogInfo("Active base frame matrix rotation in degrees: " + str(activeBaseFrameMatrix.GetRotation(True)))

 


 

GetMatrixToBaseFrame(baseFrameIndex: unsigned int): CENPyOlpMatrix

 

o

baseFrameIndex

Index of the base frame to which this toolpath element matrix should be relative

 

o

return

Matrix relative to the given base frame index

 

Returns the matrix of the toolpath element relative to the specified base frame

 

[Example]

   baseFrameIndex = 0

   baseFrameMatrix = currentTpElement.GetMatrixToBaseFrame(baseFrameIndex)

   if baseFrameMatrix.IsValid():

      logging.LogInfo("Base frame index <" + str(baseFrameIndex) + "> position: " + str(baseFrameMatrix.GetPosition().GetXYZ()))

      logging.LogInfo("Base frame index <" + str(baseFrameIndex) + "> rotation in degrees: " + str(baseFrameMatrix.GetRotation(True)))

 


 

GetTrack(): CENPyOlpTrack

 

o

return

Toolpath track

 

Get the track corresponding to this toolpath element.

 

[Example]

   program = Operator.GetActiveProgram()

   tpes = program.GetTpElements()

   track = tpes[5].GetTrack()

 


 

 

 


Previous
Previous page
Chapter
Chapter page
Next
Next page