AutoCAD Map 3D Developer

Posts: 20
Registered: ‎05-16-2006
Message 1 of 2 (457 Views)

VB.NET Map Query

457 Views, 1 Replies
05-19-2011 08:49 AM

Hi All,

  I have a problem with VB.NET and Map using ActiveX interface.

I have an error when I try to add a new condition to QueryBranch



Dim objQB As AutocadMAP.QueryBranch = objQuery.QueryBranch
Dim objPCond As Object = objQB.Add(EClassId.kQueryBranch, EJoinOperator.kOperatorAnd) 
The same code in VB6 work fine!!!
Can you help me?


ADN Support Specialist
Posts: 543
Registered: ‎06-09-2009
Message 2 of 2 (452 Views)

Re: VB.NET Map Query

05-19-2011 11:37 PM in reply to: matteo.conte

Hi Matteo,


Check if the following approach resolves this issue ?




Public Function TestDefQuery()
Dim mapApi As Autodesk.Gis.Map.MapApplication
mapApi = MAP.HostMapApplicationServices.Application

Dim project As PROJECT.ProjectModel
project = mapApi.ActiveProject

'create location condition
Dim JointOp As New MAPCONSTANTS.JoinOperator()
Dim locationType As New MAPCONSTANTS.LocationType()
'Dim qryCondition As MAPQUERY.LocationCondition = New MAPQUERY.LocationCondition(JointOp.OperatorAnd, locationType.LocationInside)
Dim qryCondition As MAPQUERY.LocationCondition = New MAPQUERY.LocationCondition(JointOp.OperatorAnd)
Dim allBdry As MAPQUERY.AllBoundary
allBdry = maputil.NewAllBoundary()
qryCondition.Boundary = allBdry

'create branch
Dim qryBranch As New MAPQUERY.QueryBranch(JointOp.OperatorAnd)


End Function






Partha Sarkar
Autodesk Developer Network

Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.