select multiple objects

select multiple objects

W_T_
Advocate Advocate
481 Views
4 Replies
Message 1 of 5

select multiple objects

W_T_
Advocate
Advocate

This LISP,
It can only select one object.
I hope it can select multiple objects

(defun c:Erase-All-R ()
 (command "_.ERASE" "_ALL" "_R")
 (princ "\nPlease select objects and press Enter.") 
 (command pause )
 (command "")
 (princ)
)

 

0 Likes
Accepted solutions (2)
482 Views
4 Replies
Replies (4)
Message 2 of 5

paullimapa
Mentor
Mentor
Accepted solution

 

(defun c:Erase-All-R ()
 (command "_.ERASE" "_ALL" "_R")
 (princ "\nPlease select objects and press Enter.") 
; (command pause )
  (while (> (getvar "CMDACTIVE") 0)(vl-cmdf pause)) 
; (command "")
 (princ)
)

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 3 of 5

Kent1Cooper
Consultant
Consultant
Accepted solution

This is all you really need:

(defun C:EAB () (command-s "_.erase" "_all" "_remove") (prin1))

The command will supply its own prompt for removing objects from the selection, so you don't need to write that out.

[EAB stands for Erase All But -- change it to whatever you prefer.]

Kent Cooper, AIA
Message 4 of 5

W_T_
Advocate
Advocate

いつもありがとうございます。

0 Likes
Message 5 of 5

paullimapa
Mentor
Mentor

Glad to have helped….cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes