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.
|
||||
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")