GetSample()

Summary

Gets a sample object indicating how features in a layer or selection set display on a map.

Syntax

sample = GetSample(string layer_set)

Argument Contents
layer_set Name of the input layer or selection set

Returns

A sample point, line, or area object, depending on the type of the layer, showing how a feature in the layer is displayed for the layer or selection set. The sample has the graphic on the left and the name of the layer or selection set on the right

Notes

  • All samples are based on the appearance of the layer or selection set in the current map.

  • Samples for a selection set show how features look if they are in only that selection set. Features belonging to multiple selection sets may look different.

  • You can change or remove the name of the layer or selection set from the sample object with SetSampleText().

Example

// Get a sample of how a State feature is displayed
smp1 = GetSample("States|")
// Get a sample for the selected States and remove the selection set name
smp2 = SetSampleText(GetSample("States|Selection"), null)

Error Codes

Error Type Meaning
NotFound The layer or set does not exist

See Also

Function Summary
GetThemeSamples() Gets sample objects indicating how features in a theme display on a map.
SamplePoint() Creates a sample point object for use in a menu or dialog box
SampleLine() Creates a sample line object for use in a menu or dialog box
SampleArea() Creates a sample area object for use in a menu or dialog box
SaveSampleToImage() Saves a sample object to an image file.
SetSampleText() Creates a sample object based on an input sample with the specified text for use in a menu or dialog box