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

SclGraphicsOpen

Overview

Open a new graphics node in the graphics database.

Synopsis

SclGraphicsOpen $nodeName

Description

This command opens a new node in the graphics database. For each SclGraphicsOpen there must be a corresponding SclGraphicsClose command within the script. Nodes may be opened inside other nodes to create a complex node hierarchy.

Arguments

  • nodeName
  • The name of the node that is to be opened. There are some restrictions on node names. Do not start a node name with '/' or '?'. The '/' character is a delimiter between names in a complex node hierarchy in manner similar to directory names in a complex directory path. It is legal to open a node named 'a/b/c'. This will create node a, and within it node b and within it node c. Only a single SclGraphicsClose command is required in this instance.

    Node names starting with '..' are relative node names and imply up one level in the node hierarchy.

Returns

The key to the opened node.

Examples

#
# Open a node called 'mygraphicsnode' and insert a marker
# For the marker to be visible the coordinates of the marker must
# be contained within the current screen extents
#
# This example shows how to animate a marker using quick moves and
# inserting and then deleting markers at different positions
#
set segKey [SclGraphicsOpen mygraphicsnode]
  SclGraphicsSetHeuristics "quick moves=on"
  set key [SclGraphicsInsertMarker 2450 6750 150]
  SclGraphicsSetMarkerSymbol {[*]}
  SclGraphicsSetMarkerSize 2
  SclGraphicsSetColour yellow
  set y 6750
  for {set i 0} {$i < 100} {incr i} {
    SclGraphicsDeleteByKey $key
    set y [expr $y + 1]
      if {$i == 50} {
        SclGraphicsSetColour red
      
      }
    set key [SclGraphicsInsertMarker 2450 $y 150]
    SclGraphicsUpdateDisplay
  }
#
# Note: There must be an SclGraphicsClose segment to
# match each SclGraphicsOpen
#
SclGraphicsClose

See Also

SclGraphicsCloseSegment