CreateScaledObject - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Enlarge or reduce objects with a scaling factor; corresponds to choosing Spatial > Edit > Modify > Scale. This function requires the MapCAD Tool and can be executed via the Exec() command. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

Exec("MapCAD.mbx","CreateScaledObject", SourceObj, ScaleFactor, Anchor)

Return Value

Depending on the type of the source object. If no scaled object can be created or the function failed, the return object is a point(0,0).

Description

Use the CreateScaledObject function to scale (larger/smaller) a source object by a multiplication factor. The scaling is in reference to the anchor point.

The MapCAD tool must be loaded. This function requires an active map window to determine the projection and units. To set the calculation accuracy, open the MapCAD settings dialog.
Parameters Description
SourceObj Object value, All types
ScaleFactor Float value: specifies the multiplication factor. For example, a factor of 0.5 halves, a factor of 2 doubles.
Anchor

X, Y

1 = left, top

2 = center, top

3 = right, top

4 = left, center

5 = center, center

6 = right, center

7 = left, bottom

8 = center, bottom

9 = right, bottom

Examples

'Create a new scaled object.
Dim NewObj as object 
NewObj = Exec("MapCAD.mbx","CreateScaledObject", SourceObj ,0.5,5)