Defines an SQL condition.
SetSQLCond( _
LTNName As String, _
SQLWhere As String _
) As Boolean
Returns True on success.
LTNName
SQLWhere
Note Call this method only if the QueryLeaf object's Type property is kSQLCondition.
The following example defines an SQL condition.
Dim amap As AcadMap
Dim prj As Project
Dim qry As Query
Dim atdr As AttachedDrawing
Dim mainqrybr As QueryBranch
Dim andqrybr As QueryBranch
Dim sqlqrylf As QueryLeaf
Dim qrylf As QueryLeaf
Dim boolVal As Boolean
Dim whereVal as String
Dim strLT as String
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 sqlqrylf = andqrybr.Add(kDataCondition, kOperatorOr)
boolVal = qrylf.SetLocationCond(kLocationInside, _
prj.MapUtil.NewLocationAll)
strLT = "Link template name goes here"
whereVal = "Top = 500 AND Left = 250"
boolVal = sqlqrylf.SetSQLCond("LTname", WhereVal)