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

Add filtered selections and SSADD

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
195 Views, 4 Replies

Add filtered selections and SSADD

Why is this failing?

(while
(setq a (getpoint "\nSpecify first corner: "))
(progn (initget 32)
(setq b (getcorner a "\nSpecify other corner: "))
)
(setq tmpsol (ssget "C" a b '((0 . "3DSOLID"))))
(repeat (sslength tmpsol)
(setq ent (ssname tmpsol cnt)
cnt (1+ cnt)
)
(ssadd ent sol1)
);end repeat
);end while
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

You should have (setq cnt 0) somewhere at the beginning of the code.

Paul

"Jason Rhymes" wrote in message
news:5884074@discussion.autodesk.com...
> Why is this failing?
>
> (while
> (setq a (getpoint "\nSpecify first corner: "))
> (progn (initget 32)
> (setq b (getcorner a "\nSpecify other corner: "))
> )
> (setq tmpsol (ssget "C" a b '((0 . "3DSOLID"))))
> (repeat (sslength tmpsol)
> (setq ent (ssname tmpsol cnt)
> cnt (1+ cnt)
> )
> (ssadd ent sol1)
> );end repeat
> );end while
Message 3 of 5
Anonymous
in reply to: Anonymous

Thanks Paul, that was it.
Message 4 of 5
Anonymous
in reply to: Anonymous

Well I thought it worked but still not working

(while
(setq a (getpoint "\nSpecify first corner: "))
(setq b (getcorner a "\nSpecify other corner: "))
(setq cnt 0)
(setq tmpsol (ssget "C" a b '((0 . "3DSOLID"))))
(repeat (sslength tmpsol)
(setq ent (ssname tmpsol cnt)
cnt (1+ cnt)
)
(ssadd ent sol1)
);end repeat
);end while
Message 5 of 5
Anonymous
in reply to: Anonymous

Never mind. Needed (setq sol1 (ssadd))

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

Post to forums  

Autodesk Design & Make Report

”Boost