Purpose
Returns the m-value of a specific node in a region, polyline, or multipoint object. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
ObjectNodeM( 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 ObjectNodeM() function returns the m-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 ObjectNodeM() function supports Multipoint objects and returns the m-value 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 an object does not support m-values, or an m-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