Defines a data condition.
SetDataCond( _
DataType As EDataQueryType, _
CondOperation As EConditionOperator, _
Table As String, _
Field As String, _
Value As Variant _
) As Boolean
Returns True on success.
DataType
CondOperation
Table
Field
Value
Note Call this method only if the QueryLeaf object's Type property is kDataCondition.
The following example performs a query for data less than the value in a table Water_Bodies, in a field called Avg_Depth with a value of 10.
Dim amap As AcadMap Dim prj As Project Dim qry As Query Dim mainqrybr As QueryBranch Dim andqrybr As QueryBranch Dim dataqrylf 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 dataqrylf = andqrybr.Add( _ kDataCondition, _ kOperatorOr) boolVal = qrylf.SetLocationCond( _ kLocationInside, _ prj.MapUtil.NewLocationAll) boolVal = dataqrylf.SetDataCond( _ kDataIRD, _ kCondLT, _ "Water_Bodies", _ "Avg_Depth", _ 10)