Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ADE_QRYDEFINE using polyline location type with (entlast) parameter return "Bad argument type" error message

104 views
Skip to first unread message

André Couture

unread,
May 14, 1998, 3:00:00 AM5/14/98
to

We want to retrieve furniture of a room using the room perimeter as
polyline location in a query. We first retrieve all the rooms perimeters
and use one at a time to retrieve the furniture to link to the room number.

In the online Autocad Map developer's guide, the folowing expression is
suggested; (ade_qrydefine '("" "" "" "Location" ("polyline" "polygon"
"crossing" (entlast)) ""). The “Bad argument type” message is return. We
had the same error message with the use of an Autolisp variable;

;Retrieving Room perimeters
(setq ade_cmddia_before_qry (getvar "cmddia"))
(setvar "cmddia" 0)
(mapcar 'ade_dwgdeactivate (ade_dslist))
(setq ade_tmpprefval (ade_prefgetval "ActivateDwgsOnAttach"))
(ade_prefsetval "ActivateDwgsOnAttach" T)
(setq dwg_id(ade_dsattach "MAPTEST:\\LIMITES.DWG"))
(ade_prefsetval "ActivateDwgsOnAttach" ade_tmpprefval)
(ade_qryclear)
(ade_qrysettype "draw")
(ade_qrydefine '("" "" "" "Property" ("layer" "=" "02LOC")""))
(ade_qrysetaltprop nil)
(ade_qryexecute)

;Retrieving room number
(SETQ SS1 (SSGET "X" '((8 . "02loc"))))
(SETQ ENT (SSNAME SS1 0))
(SETQ NUM (ADE_ODGETFIELD ENT "NUMLOC" "AREA" 0))

;Retrieving room furniture
(ade_qryclear)
(ade_qrysettype "draw")
(ade_qrydefine '("" "" "" "Property" ("layer" "=" "711")""))
(ade_qrydefine '("AND" "" "" "Location" ("polyline" "polygon" "crossing"
ENT)""))
(ade_qrysetaltprop nil)
(ade_qryexecute)

What's wrong ?

Pierre Lemire

unread,
May 14, 1998, 3:00:00 AM5/14/98
to

The problem is the list you create is interpreted differently that what
you expect by AutoLISP. When you have a lisp variable that you want
AutoLISP to evalute, you can't include it in a fixed list (one preceeded
by '). The solution is:

(ade_qrydefine (list "AND" "" "" "Location" (list "polyline" "polygon"
"crossing" ENT)""))

(Hope all the brackets match 8-) )

Good luck.
Pierre

0 new messages