RangeTable.Add method

AutoCAD Map 3D ActiveX

RangeTable.Add method

Adds a range to the range table.

Add( ExprValue As String, _
 ReturnValue As String, _
 CompareOperation As ERangeOperator _
 ) As Range

Returns a range.

ExprValue

The comparison value of the range's condition.

ReturnValue

The value to return if the range's condition is true.

CompareOperation

The comparitive operator of the range's condition.

This example is an excerpt from the sample code for altering queried objects.To go to the sample code, click . The following example shows how to set up a range table called safewater. The query uses the range table to specify a range of less than 10 feet and to return the name of the STREAM layer. The last line of code adds a property alteration to the AlterLines collection that specifies what to do with the range and return value--to move water bodies having a depth within that range to the STREAM layer.

Dim rngtb As RangeTable

Dim rng As Range

Dim altlLay As AlterLine

 

'Alter Layer Based on Range Table

prj.RangeTables.Remove ("foulwater")

Set rngtb = prj.RangeTables.Add("safewater", "shallow water")

Set rng = rngtb.Add("10", "STREAM", kRangeLT)

Set altlLay = prj.CurrQuery.AlterProp.Add( _

kAlterationLayer, _ 

"(Range :AVG_DEPTH@WATER_BODIES foulwater)")