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

Create a spline given a polyline or region; corresponds to choosing Spatial > Edit > Modify > Spline. 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"," CreateSpline", Tolerance, SourceObj)

Return Value

Polyline or Region object, depending on the type of the source object. If no spline can be calculated or the function failed, the return object is a Point (0,0).

Description

Use the CreateSpline function to create a polyline or region that is mapped from a calculated spline.

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
Tolerance Float value: specifies the maximum divergence for calculating the curvature. The smaller the value, the more precise the curve, but higher the number of nodes. Default value = 0.5.
SourceObj Object value, Polyline or Region

Examples

'Create a polyline or region as a spline.
Dim NewObj as object 
NewObj = Exec("MapCAD.mbx","CreateSpline",0.5, SourceObj)