You are here: Surpac Concepts > Macros > SCL > SCL Graphics Drawing > SclGraphicsInsertMarker
GEOVIA Surpac

SclGraphicsInsertMarker

Overview

Insert a marker into the currently open node of the graphics database at a specific XYZ location.

Synopsis

SclGraphicsInsertMarker $x $y $z

Description

This command inserts a marker at the specified XYZ location. The marker symbol, size and colour are determined by other SclGraphics commands.

Arguments

  • x, y, z
  • Pass by value. The XYZ coordinates of the marker. If these values place the marker outside the screen extents the marker will not be visible.

Returns

The key to the marker so that it can be selectively deleted using SclGraphicsDeleteByKey.

Examples

#
# This example shows how animation can be achieved by successively
# inserting and deleting markers at slightly different locations
#
set segKey [SclGraphicsOpen mynode]
  SclGraphicsSetHeuristics "quick moves=on"
  
  # insert the marker and retain its key for later deletion  
  set key [SclGraphicsInsertMarker 2450 6750 150]
  SclGraphicsSetMarkerSymbol {[*]}
  SclGraphicsSetMarkerSize 2
  SclGraphicsSetColour yellow
  set y 6750
  for {set i 0} {$i < 100} {incr i} {
    # animate by deleting the marker and inserting another at a
    # different location
    SclGraphicsDeleteByKey $key
    set y [expr $y + 1]
      if {$i == 50} {
        # let's make the marker red after a little while
        SclGraphicsSetColour red
      
      }
    set key [SclGraphicsInsertMarker 2450 $y 150]
    SclGraphicsUpdateDisplay
  }
SclGraphicsClose
puts "Press a mouse button to continue"
SclPause
#
# delete the final marker and the node containing the marker
#
SclGraphicsDeleteByKey $key
SclGraphicsDeleteByKey $segKey
SclGraphicsUpdateDisplay

See Also

SclGraphicsSetMarkerSymbol
SclGraphicsSetMarkerSize

SclGraphicsSetColour

SclGraphicsOpen