Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 3
rajeshpatnaik2001
247 Views, 2 Replies

Map Query

HI,

 

I want to select the objects in the curent drawing which have a specific field value. The table name is "TABLE", and filed name is "FIELD" and the value is "VALUE". In my test drawing, there are two polygons with this table and value.

I use the following codes.

 

To define the query:

(ade_qrydefine '("" "" "" "Data"  ("objdata" "TABLE.FIELD" "=" "VALUE")""))

 

To execute the query and get the selection set of objects:

 

(ade_prefsetval "MkSelSetWithQryObj" T)
(if (> (ade_qryexecute) 0.0)
    (setq queried_objects (ssget "P"))
    (princ "\nNo objects found.")
)

 

But I am getting at command prompt,
0 object(s) have been queried

and the selection set is empty.

Why I am not getting any objects in query? where is the mistake?

 

Any help in this regard will be highly appreciated.

 

Thanks

 

Rajesh

 

2 REPLIES 2
Message 2 of 3
hmsilva
in reply to: rajeshpatnaik2001

Hi rajeshpatnaik2001,

I'm not a Map guy, therefore untested...

Don't you need to previously set the query mode with ade_qrysettype, then define the query and lastly executes the current query?

Henrique

EESignature

Message 3 of 3

Have you attach the drawing to query ?

You need to attach the drawing (ade_dsattach) to query the objects.

(ade_dsattach "dwg_drive:\\mydrawing.dwg"))

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost