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

SclGraphicsInsertPolyline

Overview

Insert a polyline into the currently open node of the graphics database.

Synopsis

SclGraphicsInsertPolyline $xlist $ylist $zlist

Description

This command inserts a polyline at the specified XYZ location. The polyline line weight, line pattern, and colour are determined by other SclGraphics commands.

A polyline is a geometric object defined by a series of points. If you wish the polyline to appear closed then the coordinates must define an explicit closure.

Arguments

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

    The X Y and Z values must be defined in a TCL list. All lists must be non-zero in length and they must have equal numbers of entries.

Returns

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

Examples

#
# Create a node and insert a small polyline
#
SclGraphicsOpen mygraphicsnode
  # create the lists of coordinate values
  set xlist [list 2480 2481 2486 2490]
  set ylist [list 6750 6760 6750 6740]
  set zlist [list 150 140 150 160]
  # insert the polyline and remember its key
  set key [SclGraphicsInsertPolyline $xlist $ylist $zlist ]
  # set the rendering attributes
  SclGraphicsSetColour "lines=pink"
  SclGraphicsSetVisibility "markers=on"
  SclGraphicsSetLineWeight 2
  SclGraphicsSetLinePattern "-.-."
SclGraphicsClose
# and now make sure we can see it
SclGraphicsUpdateDisplay

See Also

SclGraphicsSetLinePattern
SclGraphicsSetLineWeight

SclGraphicsSetColour