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

Select Multiple Objects

4 REPLIES 4
Reply
Message 1 of 5
dvanerem
496 Views, 4 Replies

Select Multiple Objects

I cannot seem to figure out how I can make this pick more than one object. I know that it must be realatively simple, but everything that I have tried has not worked. Can someone help?

(defun C:MM-BYBLOCK ( / ENT SCMDE SORMOD VLAY)

(setq SOSMOD (getvar "osmode")) ; captures current snap settings
(setq SCMDE (getvar "cmdecho")) ; capture current setting
(setq SORMOD (getvar "orthomode")) ; capture current setting
(setvar "cmdecho" 0) ; stop screen output
(setvar "osmode" 0) ; set osnap to none
(setvar "orthomode" 0) ; set ortho off

(setq ENT (entsel "\nSelect Object :"))

(command "change" ENT "" "p" "la" "0" "C" "byblock" "")

(setvar "cmdecho" SCMDE) ; reset
(setvar "orthomode" SORMOD) ; reset
(setvar "osmode" SOSMOD) ; reset snap mode
(gc)
(princ)
)
4 REPLIES 4
Message 2 of 5
Kent1Cooper
in reply to: dvanerem

Use (ssget) rather than (entsel) if you want more than one object.

--
Kent Cooper


dvenerem wrote...
I cannot seem to figure out how I can make this pick more than one object....
....
(setq ENT (entsel "\nSelect Object :"))
....
Kent Cooper, AIA
Message 3 of 5
dvanerem
in reply to: dvanerem

I did put this in my code, but it does not seem to work. Can you elaborate a little more.
Message 4 of 5
Kent1Cooper
in reply to: dvanerem

It wouldn't work if you simply substitute the term "ssget" in place of "entsel" -- the functions use different arguments [e.g. you can't spell out a prompt in (ssget), but it has many powerful options that (entsel) doesn't]. See the AutoLisp Reference for details on how to use it -- that will be the best elaboration. If you try it and it doesn't work, you can post what you tried, and someone will probably be able to tell you how to fix it.

--
Kent Cooper
Kent Cooper, AIA
Message 5 of 5
tcorey
in reply to: dvanerem

Here's the code:



(setq SSET (ssget))



(command "change" SSET "p" "la" .......





Tim Corey


Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller

New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut

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

Post to forums  

Autodesk Design & Make Report

”Boost