MapQuery in Visual Basic

MapQuery in Visual Basic

Anonymous
Not applicable
382 Views
2 Replies
Message 1 of 3

MapQuery in Visual Basic

Anonymous
Not applicable
Hello,

i've opened a new drawing and I want to attach DWG's and do a query...then i
want to save this in DWF....

but my problem is...i can't get the Autodesk Map-Object
If i get the Map-Object in Visual Basic then everything will be ok !!!


Thank you for help


Here is my code....


Dim acad_object As New AcadApplication
Dim acad_doc As AcadDocument
Dim amap As AcadMap
Dim prj As Project
Dim qry As Query

Set acad_doc = acad_object.ActiveDocument
acad_object.Visible = True


'Get Autodesk Map and Project Objects
Set amap =
acad_object.Application.GetInterfaceObject("AutoCADMap.Application")
Set prj = amap.Projects(acad_object)




Thanks, Jochen
0 Likes
383 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
hi jan,

it looks the same i had, initialise your map-object-var's as "Object" and
not as AcadMap,Project,Query

hope this helps, alfred

"JAN" schrieb im Newsbeitrag
news:[email protected]...
> Hello,
>
> i've opened a new drawing and I want to attach DWG's and do a query...then
i
> want to save this in DWF....
>
> but my problem is...i can't get the Autodesk Map-Object
> If i get the Map-Object in Visual Basic then everything will be ok !!!
>
>
> Thank you for help
>
>
> Here is my code....
>
>
> Dim acad_object As New AcadApplication
> Dim acad_doc As AcadDocument
> Dim amap As AcadMap
> Dim prj As Project
> Dim qry As Query
>
> Set acad_doc = acad_object.ActiveDocument
> acad_object.Visible = True
>
>
> 'Get Autodesk Map and Project Objects
> Set amap =
> acad_object.Application.GetInterfaceObject("AutoCADMap.Application")
> Set prj = amap.Projects(acad_object)
>
>
>
>
> Thanks, Jochen
>
>
>
>
0 Likes
Message 3 of 3

Anonymous
Not applicable
hi Jan,
I had such problem too. I did VB dll than call it from Lisp, and everithing
was OK. But you cannot debug it from VB, so I write all stuff in VBA, than
copy code to VB (with some coversions) and thats it. If you find a better
solution please tell me.
Thanks.

"Alfred NESWADBA" wrote in message
news:[email protected]...
> hi jan,
>
> it looks the same i had, initialise your map-object-var's as "Object" and
> not as AcadMap,Project,Query
>
> hope this helps, alfred
>
> "JAN" schrieb im Newsbeitrag
> news:[email protected]...
> > Hello,
> >
> > i've opened a new drawing and I want to attach DWG's and do a
query...then
> i
> > want to save this in DWF....
> >
> > but my problem is...i can't get the Autodesk Map-Object
> > If i get the Map-Object in Visual Basic then everything will be ok !!!
> >
> >
> > Thank you for help
> >
> >
> > Here is my code....
> >
> >
> > Dim acad_object As New AcadApplication
> > Dim acad_doc As AcadDocument
> > Dim amap As AcadMap
> > Dim prj As Project
> > Dim qry As Query
> >
> > Set acad_doc = acad_object.ActiveDocument
> > acad_object.Visible = True
> >
> >
> > 'Get Autodesk Map and Project Objects
> > Set amap =
> > acad_object.Application.GetInterfaceObject("AutoCADMap.Application")
> > Set prj = amap.Projects(acad_object)
> >
> >
> >
> >
> > Thanks, Jochen
> >
> >
> >
> >
>
>
0 Likes