Maptitude GISDK Help

The MacroVal Object

 

The MacroVal object is a type of object defined by the COM Object that is used to encapsulate all of the special (compound) types that can be returned by the GISDK macros or functions to the client. The object may be passed back as arguments to other macros or functions, as required.

 

The properties of an object are all the possible "selectors" that the compound types can have in Caliper Script. The objects themselves know which underlying compound type they represent, and if properties are specified by the client that are not appropriate to the underlying type, an error is returned. Following the same rules as in Caliper Script, the properties of certain types can be both read and set by the client (e.g., the Width and Height of a scope), while others can only be read (e.g., the Radius of a circle).

 

Methods

MacroVal Copy() simply returns a new object, which is a copy of the original object.

 

Long IsEqual(MacroVal compare) compares the object with another object and returns 1 if they are of the same type and have the same value, or 0 if they are of the same type but of a different value. If they are of different types, an error is returned. Also, some types cannot be compared, so an error is returned. (All behavior is the same as in Caliper Script.)

 

Variant Method(string macroname, [optional Variant arg1], [optional Variant arg2]..... [optional Variant arg9]) calls a class macro on a UI Object, and returns a variant containing either the return value specified for the macro or null.

 

Variant Get(string property) gets the value of a UI Object property and returns a variant containing the value.

 

Set(string property, Variant value) sets the value of a UI Object property.

 

Properties

Property

Type

Relevant Caliper Script Compound Types

Lat

long

coord

Lon

long

coord

Center

coord

scope, circle

Width

double

scope

Height

double

scope

Angle

double

scope

Projection

array

scope

Radius

double

circle

Red

long

color

Green

long

color

Blue

long

color

 

In addition, there is the property Type that returns a string describing the macro type of the MacroVal, analagous to the TypeOf() GISDK function.

 

Example (in Visual Basic for Applications)

Set Gisdk = CreateObject("Maptitude.AutomationServer")

map_name = Gisdk.Function("OpenMap", "c:\\temp\\MyMap.map", Null)

Set scp = Gisdk.Function("GetMapScope", Null) 'this returns a MacroVal object

Set crd = scp.center 'another MacroVal object

lon = crd.lon

lat = crd.lat

 

rad = scp.width 'this returns an error as a scope does not have a radius

 

For more information, see...

The Maptitude Object

Function() Method

Macro() Method

CreateObject() Method

Accessing Maptitude as a COM Object

 

 

 

©2025 Caliper Corporation www.caliper.com