This example defines and executes a location query.
(mapcar 'ade_dwgdeactivate (ade_dslist)) (setq ade_tmpprefval (ade_prefgetval "ActivateDwgsOnAttach")) (ade_prefsetval "ActivateDwgsOnAttach" T) (ade_dsattach "E:\\ADEDWG\\ARCS2.DWG") (ade_dsattach "E:\\ADEDWG\\CIRCLES2.DWG") (ade_dsattach "E:\\ADEDWG\\DONUTS.DWG") (ade_dsattach "E:\\ADEDWG\\MAKE.DWG") (ade_dsattach "E:\\ADEDWG\\POLYLINE.DWG") (ade_prefsetval "ActivateDwgsOnAttach" ade_tmpprefval) (ade_qryclear) (ade_qrysettype 1) (ade_qrydefine '("" "" "" "Location" (1 )"")) (ade_qryexecute)