CreateParallel - 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

Creates a parallel object given a source object and a distance; corresponds to choosing Spatial > Edit > Buffer > Create Parallel. 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","CreateParallel" ,SourceObject, Distance, Orientation, CloseObject, MakeRegion)

Return Value

Line, polyline, or region object, depending on source object type and calling parameters. If the function failed the return object is a point (0,0).

Description

Use the CreateParallel function to create a new object parallel to an existing object given a distance. The parallel orientation always refers to the line direction of the source object. Parallels can be generated on one or both sides. Optionally, they can be closed or converted to regions. For regions, the orientation indicates the inside or outside parallel.

The MapCAD tool must be loaded. This function requires MapCAD and an active map window to determine the projection and units. To set the calculation accuracy, open the MapCAD settings dialog.
Parameters Description
SourceObject Object value: consists of a line, polyline, or region object.
Distance Float value: specifies the distance between the source object and the new parallel object. The Distance unit is the current map distance unit.
Orientation

Integer value: specifies the figure according to the line direction of the source object.

Line and Polyline Region

1 = Left side

2 = Right side

3 = Both sides

1 = Inside

2 = Outside

CloseObject Logical value, indicating whether the endpoints of the new object are connected to the endpoints of the source object. This option is only useful for line or polyline source objects.
MakeRegion Logical value, indicating whether the new object will be converted to a region object. This option is only useful for line or polyline source objects and includes the option CloseObject=TRUE.

Examples

'Create a left side parallel object to a line or polyline object: 
'OldObj is a line or polyline 
object NewObj = Exec("MapCAD.mbx","CreateParallel", OldObj, 2.5, 1, "F", "F")

'Create a both side parallel object to a line or polyline object, close endpoints, 
'combine and convert to region: 
'OldObj is a line or polyline 
object NewObj = Exec("MapCAD.mbx","CreateParallel", OldObj, 2.5, 3, "T", "T")

'Create a inside parallel object to a region object: 
'OldObj is a region 
object NewObj = Exec("MapCAD.mbx","CreateParallel", OldObj, 2.5, 1, "F", "F")