AlterLines.Add method

AutoCAD Map 3D ActiveX

AlterLines.Add method

Adds a property alteration to the property alteration definition.

Add( AlterType As EAlterationType, _
 Expression As String _
 ) As LPDISPATCH

Returns an AlterLine, HatchDef, or TextDef, depending on AlterType.

AlterType

Specifies the type of property alteration.

Expression

An expression, evaluated at the time of query execution, to alter properties.

The result of the expression must match the data type of the queried property. If you pass AlterationElevation as the AlterType, the Expression must evaluate to a point. If you pass kAlterationHeight, kAlterationRotation, kAlterationWidth, or kAlterationThickness, Expression must evaluate to a real. For all other values of AlterType, Expression must evaluate to a string. For more information about expressions, see "Expressions" in AutoCAD Map UI Help.

You can call this method to add a hatch or text alteration to the collection by passing the KAlterationHatch or kAlterationTextEntity constants in the first argument, as shown in the example. The API then uses the default hatch or text entity definitions. To use other definitions, call the AddHatchDef and AddTextDef methods instead of this method.

The following excerpt from a larger example defines a query that alters the color of drawing objects and adds a text entity, the name, to water bodies on the map. For the complete example, click .

 

Dim qry As Query

Dim altls As AlterLines

Dim altl As AlterLine

Dim txtdf As TextDef

' Create a query -- code not shown

Set altls = qry.AlterProp

altls.RemoveAll

Set altl = altls.Add(kAlterationColor, "RED")

Set txtdf = altls.Add( _

kAlterationTextEntity, _ 

":NAME@WATER_BODIES") 

qry.AlterTag = True

' Define and execute the query to alter properties -- code not shown