Cadcorp SIS API Methods

GetGeomLengthUpto Method

Description

Gets the length along the geometry of the current open Item up to a position.

Syntax

Visual Basic
Public Function GetGeomLengthUpto( _
   ByVal nGeom As Long, _
   ByVal arclenStart As Double, _
   ByVal x As Double, _
   ByVal y As Double, _
   ByVal z As Double _
) As Double

Parameters

nGeom
The index of the geometry component, starting at 0.
 
arclenStart
The length along the geometry component from which to start the measurement. Use -1.0 to measure from the start of the geometry.
 
x
The x coordinate position along the geometry component to measure up to.
 
y
The y coordinate position along the geometry component to measure up to.
 
z
The z coordinate position along the geometry component to measure up to.
 

Return Type

The measured length, or -1.0. The returned distance in a Cartesian coordinate system is in metres; the returned distance in a spherical coordinate system is in degrees. The returned z value in a spherical coordinate system is in metres above sea level.

Remarks

Use GetNumGeom to get the number of geometry components in an Item.

The arclenStart argument is useful for geometry which passes through a position more than once, e.g. a figure-of-eight. To handle this situation, call this method repeatedly, using -1.0 for the arclenStart argument for the first call, and the returned value for each subsequent call, until -1.0 is returned.

Whatever the value of the arclenStart argument, the returned value will be the length from the start of the geometry.

Available: GEO MM ME MD OD OM SISpy

Group:

Example

sis.GetGeomLengthUpto(0, -1, 0, 0, 0)

Evaluates the length along a simple geometry from its start up to the origin.


Send comments on this topic.

Click to return to www.cadcorp.com

© Copyright 2000-2017 Computer Aided Development Corporation Limited (Cadcorp).