Assuming "i" represents an index number, something like this. Not much testing, but I
think it works.
;; 2/20/2004
;; argument idx: a positive integer starting at zero
;; returns the ename of object at idx position
(defun test ( idx / ent elst cnt )
(setq ent (entnext)) ;first object
(setq cnt -1)
(while (/= idx cnt)
(setq ent (entnext ent))
(setq elst (entget ent))
(if
(and
(not (wcmatch (cdr (assoc 0 elst)) "ATTRIB,VERTEX,SEQEND"))
(eq "Model" (cdr (assoc 410 elst)))
)
(setq cnt (1+ cnt))
)
)
ent
) ;end
Index number (vla-item ) returns a primary vla-object. So to do the
same thing with entnext, filter out the sub-entities it returns and check the item is
in model space.
Joe Burke
"agruno" wrote in message
news:32712965.1077263878867.JavaMail.jive@jiveforum2.autodesk.com...
> how to write following Vlisp command in autolisp
>
> (vla-item *modelspace* i)
> *modelspace* is activedrawing modelspace