VB6 Error

VB6 Error

Anonymous
Not applicable
326 Views
1 Reply
Message 1 of 2

VB6 Error

Anonymous
Not applicable
Hi all,

I was trying to query map through VB6 application I am creating. My code is as follows:

Set amap = Application.GetInterfaceObject("Autocadmap.application.2")

Set prj = amap.Projects(0)

'Get Current Query

Set qry = prj.CurrQuery
qry.Clear

'_________________Done this far

'Attach DWG

Set atdr = prj.DrawingSet.Add("MAPTUT:\TUTORIAL IX\citymap7.dwg")
acdoc.SendCommand ("MAPWSACTION" & vbCr & vbCr & vbCr)

'Get Main Branch

Set mainqrybr = qry.QueryBranch

'Create Layout of Leaves and Branch

Set qrylf = mainqrybr.Add(kLocationCondition, kOperatorAnd)

--> the moment it reaches qrylf my VB6 gives error end quits...can somebody help urgently?

Regards
RM
0 Likes
327 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Did you ever find an answer? If not, do you have "MAPTUT" defined as an
ALIAS? The file name parameter in prj.drawingset.add is supposed to be
ALIAS:drawing name.

wrote in message news:6212874@discussion.autodesk.com...
Hi all,

I was trying to query map through VB6 application I am creating. My code is
as follows:

Set amap = Application.GetInterfaceObject("Autocadmap.application.2")

Set prj = amap.Projects(0)

'Get Current Query

Set qry = prj.CurrQuery
qry.Clear

'_________________Done this far

'Attach DWG

Set atdr = prj.DrawingSet.Add("MAPTUT:\TUTORIAL IX\citymap7.dwg")
acdoc.SendCommand ("MAPWSACTION" & vbCr & vbCr & vbCr)

'Get Main Branch

Set mainqrybr = qry.QueryBranch

'Create Layout of Leaves and Branch

Set qrylf = mainqrybr.Add(kLocationCondition, kOperatorAnd)

--> the moment it reaches qrylf my VB6 gives error end quits...can somebody
help urgently?

Regards
RM
0 Likes