Create Pline statement - 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 polyline object. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Create Pline 
	[ Into { Window window_id | Variable var_name } ] 
	[ Multiple num_sections ]
	num_points ( x1, y1 ) ( x2, y2 ) [ ... ]
	[ Pen... ]
	[ Smooth ] [ Priority n ] [ Name framename ]

window_id is a window identifier.

var_name is the name of an existing object variable.

num_points specifies how many nodes the polyline will contain.

num_sections specifies how many sections the multi-section polyline will contain.

each x, y pair defines a node of the polyline.

The Pen clause specifies a line style.

n is an integer value indicating the Z-Order value of objects (frames) on the Layout window.

framename is a string representing the name for this item in a Layout window.

Description

The Create Pline statement creates a polyline object. If you need to create a polyline object, but do not know until run-time how many nodes the object should contain, create the object in two steps: First, use Create Pline to create an object with no nodes, and then use the Alter Object statement to add detail to the polyline object.

If the statement includes the optional Into Variable clause, the object will be stored in the specified object variable. If the Into clause specifies a Window identifier, the object will be stored in the appropriate place in the window (for example, in the editable layer of a Map window). If you omit the Into clause, MapInfo Pro attempts to store the object in the topmost window; if objects cannot be stored in the topmost window; no object is created.

The x and y parameters use whatever coordinate system MapBasic is currently using (Longitude/Latitude by default). Objects created on a Layout window, however, are specified in paper units. For details about paper units, see Set Paper Units statement. By default, MapBasic uses inches as the paper unit. To use a different paper unit, use the Set Layout statement. If you need to create objects on a Layout window, you must first issue a Set CoordSys Layout statement.

The optional Pen clause specifies a line style. If no Pen clause is specified, the Create Pline statement will use the current line style (the style which appears in the MapInfo Pro Line Style dialog box). Smooth will smooth the line so that it appears to be one continuous line with curves instead of angles.

When creating a clone statement or saving a workspace, MapInfo Pro normalizes the priority of frames to a unique set of values beginning with one (1). Use the Priority clause to assign the Z-Order of the newly created object frame on the Layout window.

The Name clause assigns a name to a frame in the Layout window. If a name is assigned, it is written to the workspace (WOR) file and the workspace version updates to 1500.

A single-section polyline can contain up to 134,217,724 nodes. The maximum number of segments in a multi-segment polyline is 24,403,223.

See Also:

Alter Object statement, Insert statement, Pen clause, Set CoordSys statement, Update statement