Python scripting - Objects

CENPyOlpInterpolationHandler

 

Methods

 

CreatePathInterpolation(startTpElement: CENPyOlpTpElement, endTpElement: CENPyOlpTpElement, types: list ): int

 

o

startTpElement

Start toolpath element

 

o

endTpElement

End toolpath element

 

o

types

One or more types of interpolation to create: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Create path interpolations between given toolpath elements.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tpes = program.GetTpElements()

   firstTpe = tpes[0]

   lastTpe = tpes[-1]

   if firstTpe and lastTpe:

      result = interpolationHandler.CreatePathInterpolation(firstTpe, lastTpe, [INTERPOLATIONTYPE_OFFSETRELATIVE, INTERPOLATIONTYPE_TANGENTRELATIVE])

      if result != 0: logging.LogError(f"Create interpolation error = {result}.")

 


 

DeletePathInterpolation(startTpElement: CENPyOlpTpElement, endTpElement: CENPyOlpTpElement, types: list ): int

 

o

startTpElement

Start toolpath element

 

o

endTpElement

End toolpath element

 

o

types

One or more types of interpolation to delete: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Delete path interpolations between given toolpath elements.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tpes = program.GetTpElements()

   firstTpe = tpes[0]

   lastTpe = tpes[-1]

   if firstTpe and lastTpe:

      result = interpolationHandler.DeletePathInterpolation(firstTpe, lastTpe, [INTERPOLATIONTYPE_TANGENTRELATIVE])

      if result != 0: logging.LogError(f"Delete interpolation error = {result}.")

 


 

SwitchPathInterpolationType(startTpElement: CENPyOlpTpElement, endTpElement: CENPyOlpTpElement, types: list ): int

 

o

startTpElement

Start toolpath element

 

o

endTpElement

End toolpath element

 

o

types

One or more current types of interpolation that should be switched: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Switch path interpolations types for given toolpath elements between Relative and Absolute, or between JoltSmooth and JoltFix.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tpes = program.GetTpElements()

   firstTpe = tpes[0]

   lastTpe = tpes[-1]

   if firstTpe and lastTpe:

      result = interpolationHandler.SwitchPathInterpolationType(firstTpe, lastTpe, [INTERPOLATIONTYPE_OFFSETRELATIVE])

     if result != 0: logging.LogError(f"Switch interpolation type error = {result}.")

 


 

AddPathInterpolationSupport(tpElement: CENPyOlpTpElement, types: list ): int

 

o

tpElement

Reference toolpath element

 

o

types

One or more types of interpolation to add support to: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Add given toolpath element as support for the specified types of path interpolations.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tpes = program.GetTpElements()

   mid = int(len(tpes)/2)

   middleTpe = tpes[mid]

   if middleTpe:

      result = interpolationHandler.AddPathInterpolationSupport(middleTpe, [INTERPOLATIONTYPE_OFFSETRELATIVE, INTERPOLATIONTYPE_TANGENTRELATIVE])

      if result != 0: logging.LogError(f"Add support error = {result}.")

 


 

RemovePathInterpolationSupport(tpElement: CENPyOlpTpElement, types: list ): int

 

o

tpElement

Reference toolpath element

 

o

types

One or more types of interpolation to remove support from: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Remove given toolpath element as support for the specified types of path interpolations.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tpes = program.GetTpElements()

   mid = int(len(tpes)/2)

   middleTpe = tpes[mid]

   if middleTpe:

      result = interpolationHandler.RemovePathInterpolationSupport(middleTpe, [INTERPOLATIONTYPE_TANGENTRELATIVE])

     if result != 0: logging.LogError(f"Remove support error = {result}.")

 


 

CreateSurfaceInterpolation(startTrack: CENPyOlpTrack, endTrack: CENPyOlpTrack, types: list ): int

 

o

startTpElement

Start toolpath track

 

o

endTpElement

End toolpath track

 

o

types

One or more types of interpolation to create: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Create surface interpolations between given toolpath tracks.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tracks = program.GetTracks()

   firstTrack = racks[0]

   lastTrack = racks[-1]

   if firstTrack and lastTrack:

      result = interpolationHandler.CreateSurfaceInterpolation(firstTrack, lastTrack, [INTERPOLATIONTYPE_NORMALABSOLUTE, INTERPOLATIONTYPE_TANGENTRELATIVE])

      if result != 0: logging.LogError(f"Create interpolation error = {result}.")

 


 

DeleteSurfaceInterpolation(startTrack: CENPyOlpTrack, endTrack: CENPyOlpTrack, types: list ): int

 

o

startTpElement

Start toolpath track

 

o

endTpElement

End toolpath track

 

o

types

One or more types of interpolation to delete: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Delete surface interpolations between given toolpath tracks.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tracks = program.GetTracks()

   firstTrack = racks[0]

   lastTrack = racks[-1]

   if firstTrack and lastTrack:

      result = interpolationHandler.DeleteSurfaceInterpolation(firstTrack, lastTrack, [INTERPOLATIONTYPE_NORMALABSOLUTE, INTERPOLATIONTYPE_TANGENTRELATIVE])

      if result != 0: logging.LogError(f"Delete interpolation error = {result}.")

 


 

SwitchSurfaceInterpolationType(startTrack: CENPyOlpTrack, endTrack: CENPyOlpTrack, types: list ): int

 

o

startTpElement

Start toolpath track

 

o

endTpElement

End toolpath track

 

o

types

One or more current types of interpolation that should be switched: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Switch surface interpolations types for given toolpath elements between Relative and Absolute, or between JoltSmooth and JoltFix.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tracks = program.GetTracks()

   firstTrack = racks[0]

   lastTrack = racks[-1]

   if firstTrack and lastTrack:

      result = interpolationHandler.SwitchSurfaceInterpolationType(firstTrack, lastTrack, [INTERPOLATIONTYPE_NORMALABSOLUTE])

      if result != 0: logging.LogError(f"Switch interpolation type error = {result}.")

 


 

AddSurfaceInterpolationSupport(track: CENPyOlpTrack, types: list ): int

 

o

tpElement

Reference toolpath track

 

o

types

One or more types of interpolation to add support to: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Add given toolpath element as support for the specified types of surface interpolations.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tracks = program.GetTracks()

   mid = int(len(tracks)/2)

   middleTrack = tracks[mid]

   if middleTrack:

      result = interpolationHandler.AddSurfaceInterpolationSupport(middleTrack, [INTERPOLATIONTYPE_NORMALABSOLUTE, INTERPOLATIONTYPE_TANGENTRELATIVE])

      if result != 0: logging.LogError(f"Add support error = {result}.")

 


 

RemoveSurfaceInterpolationSupport(track: CENPyOlpTrack, types: list ): int

 

o

tpElement

Reference toolpath track

 

o

types

One or more types of interpolation to remove support from: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Add given toolpath element as support for the specified types of surface interpolations.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tracks = program.GetTracks()

   mid = int(len(tracks)/2)

   middleTrack = tracks[mid]

   if middleTrack:

      result = interpolationHandler.RemoveSurfaceInterpolationSupport(middleTrack, [INTERPOLATIONTYPE_TANGENTRELATIVE])

      if result != 0: logging.LogError(f"Remove support error = {result}.")

 


 

IsInterpolated(tpElement: CENPyOlpTpElement, types: list ): int

 

o

tpElement

Reference toolpath element

 

o

types

Type of interpolation to check for: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Check whether or not the given toolpath element has the path interpolation of the given type.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tpes = program.GetTpElements()

   firstTpe = tpes[0]

   if firstTpe:

      isInterpolated = interpolationHandler.IsInterpolated(firstTpe, INTERPOLATIONTYPE_OFFSETRELATIVE)

      logging.LogInfo(f"Interpolated result of first TPE = {isInterpolated}.")

 


 

IsInterpolated(track: CENPyOlpTrack, types: list ): int

 

o

tpElement

Reference toolpath track

 

o

types

Type of interpolation to check for: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Check whether or not the given track has the surface interpolation of the given type.

Track is considered as interpolated if its event based start toolpath element has interpolation.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tracks = program.GetTracks()

   firstTrack = racks[0]

   if firstTrack:

      isInterpolated = interpolationHandler.IsInterpolated(firstTrack, INTERPOLATIONTYPE_NORMALRELATIVE)

     logging.LogInfo(f"Interpolated result of first track = {isInterpolated}.")

 


 

IsSupport(tpElement: CENPyOlpTpElement, types: list ): int

 

o

tpElement

Reference toolpath element

 

o

types

Type of interpolation to check for: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Check whether or not the given toolpath element is a support of any kind for a particular interpolation type.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tpes = program.GetTpElements()

   mid = int(len(tpes)/2)

   middleTpe = tpes[mid]

   if middleTpe:

      isSupport = interpolationHandler.IsSupport(middleTpe, INTERPOLATIONTYPE_NORMALRELATIVE) # True

      logging.LogInfo(f"Support result of middle TPE = {isSupport}.")

 


     

IsSupport(track: CENPyOlpTrack, types: list ): int

 

o

tpElement

Reference toolpath track

 

o

types

Type of interpolation to check for: InterpolationType

 

o

return

ERR_NO_ERROR (0) if successful, error code otherwise(InterpolationErrorCodes)

 

Check whether or not the given track is a support of any kind for a particular interpolation type.

Track is considered as a support if its event based start toolpath element is a support.

 

[Example]

   interpolationHandler = Operator.GetInterpolationHandler()

   program = Operator.GetActiveProgram()

   tracks = program.GetTracks()

   mid = int(len(tracks)/2)

   middleTrack = tracks[mid]

   if middleTrack:

      isSupport = interpolationHandler.IsSupport(middleTrack, INTERPOLATIONTYPE_NORMALRELATIVE) # True

      logging.LogInfo(f"Support result of middle track = {isSupport}.")

 


 

 


Previous
Previous page
Chapter
Chapter page
Next
Next page