Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Visual lisp v autolisp

4 REPLIES 4
Reply
Message 1 of 5
agruno
113 Views, 4 Replies

Visual lisp v autolisp

how to write following Vlisp command in autolisp

(vla-item *modelspace* i)
*modelspace* is activedrawing modelspace
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: agruno

Hi, "agruno" In autolisp you have to prompt for (vl-load-com) Regards, > how to write following Vlisp command in autolisp > > (vla-item *modelspace* i) > *modelspace* is activedrawing modelspace
Message 3 of 5
Anonymous
in reply to: agruno

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
Message 4 of 5
agruno
in reply to: agruno

Thank you very match
Message 5 of 5
Anonymous
in reply to: agruno

You're welcome. I should add, there's no error checking in that program. For instance, it will error if you pass an index number larger than the number of objects in model space. It's only intended to demonstrate a possible solution to the question you asked. Joe Burke "agruno" wrote in message news:9957823.1077280049900.JavaMail.jive@jiveforum1.autodesk.com... > Thank you very match

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

Post to forums  

Autodesk Design & Make Report

”Boost