ObjectNodeZ() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
ft:locale
en-US
Product name
MapBasic
ft:title
MapInfo MapBasic Reference
First publish date
1985
ft:lastEdition
2023-09-12
ft:lastPublication
2023-09-12T16:32:32.686000

Purpose

Returns the z-value of a specific node in a region, polyline, or multipoint object.

Syntax

ObjectNodeZ( object, polygon_num, node_num )

object is an Object expression.

polygon_num is a positive integer value indicating which polygon or section to query. It is ignored for Multipoint objects (it used for regions and polylines).

node_num is a positive integer value indicating which node to read.

Return Value

Float

Description

The ObjectNodeZ() function returns the z-value of a specific node from a region, polyline, or multipoint object.

The polygon_num parameter must have a value of one or more. This specifies which polygon (if querying a region) or which section (if querying a polyline) should be queried. Call the ObjectInfo() function to determine the number of polygons or sections in an object. The ObjectNodeZ() function supports Multipoint objects and returns the z-coordinate of a specific node in a Multipoint object.

The node_num parameter must have a value of one or more; this tells MapBasic which of the object's nodes should be queried. You can use the ObjectInfo() function to determine the number of nodes in an object.

If object does not support Z-values, or Z-value for this node is not defined, then an error is thrown.

Example

The following example queries the first graphic object in the table Routes. If the first object is a polyline, the program queries z-coordinates and m-values of the first node in the polyline.

Dim i_obj_type As SmallInt,
	z, m As Float
Open Table "routes" 
Fetch First From routes 
	' at this point, the expression: 
	' routes.obj 
	' represents the graphical object that's attached 
	' to the first record of the routes table. 
i_obj_type = ObjectInfo(routes.obj, OBJ_INFO_TYPE) 
If i_obj_type = OBJ_PLINE Then 
	' ... then the object is a polyline... 
	z = ObjectNodeZ(routes.obj, 1, 1) ' read z-coordinate
	m = ObjectNodeM(routes.obj, 1, 1) ' read m-value
End If 

See Also:

Querying Map Objects, ObjectInfo() function