Query - Automation

 

The Query method queries maps or objects. Boundary objects must have associated primary IDs in order to use the Query method.

 

Syntax

object.Query( Verb, Region, Expression, Area, Curve, Point, Rectangle, RoundedRect, Square, Ellipse, Circle, PartiallyInRegion, AllVisibleLayers, FillFGColor, FillBGColor, FillTransparent, FillPattern, LineColor, LineStyle, LineWidth, SymbolSet, SymbolIndex, SymbolSize, SymbolFillColor, SymbolLineColor, FillPatternScale, FillPatternCoverMode, MatchCase )

 

Parameter

Type

Description

Verb

MVQueryVerb

optional; action to take with query results

Region

MVQueryRegion

optional; what to query

Expression

String

optional; query expression (Where box in the Query dialog)

Area

Boolean

optional; true to return areas for query results

Curve

Boolean

optional; true to return curves for query results

Point

Boolean

optional; true to return points for query results

Rectangle

Boolean

optional; true to return rectangles for query results

RoundedRect

Boolean

optional; true to return rounded rectangles for query results

Square

Boolean

optional; true to return squares for query results

Ellipse

Boolean

optional; true to return ellipses for query results

Circle

Boolean

optional; true to return circles for query results

PartiallyInRegion

Boolean

optional; true to include objects that partially touch zones

AllVisibleLayers

Boolean

optional; true to use all visible layers

FillFGColor

MVColor

optional; foreground fill color if the Verb is mvQueryVerbApplyProperty, see remarks

FillBGColor

MVColor

optional; background fill color if the Verb is mvQueryVerbApplyProperty, see remarks

FillTransparent

Boolean

optional; if the Verb is mvQueryVerbApplyProperty, true to make background fill transparent, FillPattern must be stock or vector

FillPattern

String

optional; fill pattern if the Verb is mvQueryVerbApplyProperty

LineColor

MVColor

optional; line color if the Verb is mvQueryVerbApplyProperty

LineStyle

String

optional; line style if the Verb is mvQueryVerbApplyProperty

LineWidth

Double

optional; line width if the Verb is mvQueryVerbApplyProperty

SymbolSet

String

optional; symbol set if the Verb is mvQueryVerbApplyProperty

SymbolIndex

Integer

optional; symbol number if the Verb is mvQueryVerbApplyProperty, see remarks

SymbolSize

Double

optional; symbol size if the Verb is mvQueryVerbApplyProperty

SymbolFillColor

MVColor

optional; symbol color if the Verb is mvQueryVerbApplyProperty

SymbolLineColor

MVColor

optional; symbol outline color if the Verb is mvQueryVerbApplyProperty

FillPatternScale

Double

optional; vector pattern scale if the Verb is mvQueryVerbApplyProperty

FillPatternCoverMode

MVFillCoverMode

optional; picture pattern cover or tile if Verb is mvQueryVerbApplyProperty, default is mvFillCoverModeTile

MatchCase

Boolean

optional; match case in search if the Verb is mvQueryVerbApplyProperty

 

Remarks

 

Example

    'Query (several examples below)

    'Create a pin map of US cities and assign it to the variable "PinMap"

    Set PinMap = Plot.CreatePinMap(DataFileName:=mvApp.ModuleFolder + "\Samples\uscity.dat", _

        XCol:=3, YCol:=4)

 

    'Query the map to select all points whose longitude value is less than -110.

    Plot.Query(Verb:=mvQueryVerbSelect, Point:=True, Expression:="[Longitude]<-110")

 

    'Query the map to change points whose PID starts with "M" to have a red symbol

    Plot.Query(Verb:=mvQueryVerbApplyProperty, Point:=True, Expression:="[PID] = ""M*""", _

        SymbolFillColor:=mvColorRed, SymbolLineColor:=mvColorRed)

 

    'Query the map to create a report on all the points with a population greater than 100,000

    Plot.Query(Verb:=mvQueryVerbCreateReport, Point:=True, Expression:="[Population] > 100000")

 

Used by: PlotDocument