QueryLeaf.SetPropertyCond method

AutoCAD Map 3D ActiveX

QueryLeaf.SetPropertyCond method

Defines a property condition.

SetPropertyCond( _
 Property As EPropertyType, _
 CondOperation As EConditionOperator, _
 Value As Variant _
 ) As Boolean

Returns True on success.

Property

Specifies an entity property.

CondOperation

Specifies the comparison operator. Note The only valid operator in a string context is kCondEq.

Value

Specifies a string, long, or integer to use in a property condition.

Note Call this method only if the QueryLeaf object's Type property is kPropertyCondition.

The following example defines a property condition where the property is layer, the comparison operator is equal to, and the value is Stream.

Dim amap As AcadMap

Dim prj As Project

Dim qry As Query

Dim mainqrybr As QueryBranch

Dim andqrybr As QueryBranch

Dim propqrylf As QueryLeaf

Dim qrylf As QueryLeaf

Dim boolVal As Boolean

Dim atdr As AttachedDrawing

 

Set amap = ThisDrawing.Application. _

GetInterfaceObject("AutoCADMap.Application") 

Set prj = amap.Projects(ThisDrawing)

Set qry = prj.CurrQuery

Set atdr = prj.DrawingSet.Add("MAPTUT:\\citymap7.dwg")

boolVal = qry.Clear

Set mainqrybr = qry.QueryBranch

Set qrylf = mainqrybr.Add(kLocationCondition, kOperatorAnd)

Set andqrybr = mainqrybr.Add(kQueryBranch, kOperatorAnd)

Set propqrylf = andqrybr.Add(kPropertyCondition, kOperatorOr)

boolVal = qrylf.SetLocationCond(kLocationInside, _

prj.MapUtil.NewLocationAll) 

boolVal = propqrylf.SetPropertyCond(kLayer, kCondEq, "Stream")