QueryBranch.Add method

AutoCAD Map 3D ActiveX

QueryBranch.Add method

Adds a leaf or sub-branch to a query.

Add(QueryBranchOrLeaf As EClassID, _
 JoinOp As EJoinOperator) As Object

Returns a QueryBranch or QueryLeaf object.

QueryBranchOrLeaf

Type of leaf (condition) or sub-branch you are adding.

JoinOp

Join operator

The following EClassID values are valid QueryBranchOrLeaf arguments.

kQueryUnit
kQueryCondition
kQueryBranch
kPropertyCondition
kDataCondition
kLocationCondition
kSQLCondition

The following example adds a sub-branch to a query.

Dim amap As AcadMap

Dim prj As Project

Dim qry As Query

Dim mainqrybr As QueryBranch

Dim qrylf As QueryLeaf

Dim andqrybr As QueryBranch

 

Set amap = ThisDrawing.Application. _

GetInterfaceObject("AutoCADMap.Application") 

Set prj = amap.Projects(ThisDrawing)

Set qry = prj.CurrQuery

qry.Clear

Set mainqrybr = qry.QueryBranch

Set qrylf = mainqrybr.Add(kLocationCondition, kOperatorAnd)

Set andqrybr = mainqrybr.Add(kQueryBranch, kOperatorAnd)