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

ssget & entdel

3 REPLIES 3
Reply
Message 1 of 4
Anonymous
673 Views, 3 Replies

ssget & entdel

I want to delete an entity made through ssget. Unfortunately it won't work
if I use (entdel InnSet)
How can I delete this object? Thanks for any help (acad 2000)

(princ"\nSelect Openings (or for none)... " )
(if (setq InnSet (ssget '((0 .
CIRCLE,ELLIPSE,SPLINE,POLYLINE,LWPOLYLINE")))

(entdel InnSet) ;;;this line is near the end of my code
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: Anonymous

ENTDEL expects an ENAME as an argument, not a PICKSET. If it's your
intention to erase everything you selected, you can either feed the
selection set to the erase command or loop through the set, deleting
objects one at a time:

(setq i -1)
(repeat (sslength InnSet)
(entdel (ssname InnSet (setq i (1+ i))))
)

--
"That's no ordinary rabbit."
http://www.acadx.com

Visit my site for a chance to win
a free, autographed copy of
Jerry Winters' "AutoCAD Visual Basics"

"Kiwi Russ" wrote in message
news:A5E2D01616611B331CAA4225FEDCC5A9@in.WebX.maYIadrTaRb...
> I want to delete an entity made through ssget. Unfortunately it
won't work
> if I use (entdel InnSet)
> How can I delete this object? Thanks for any help (acad
2000)
>
> (princ"\nSelect Openings (or for none)... " )
> (if (setq InnSet (ssget '((0 .
> CIRCLE,ELLIPSE,SPLINE,POLYLINE,LWPOLYLINE")))
>
> (entdel InnSet) ;;;this line is near the end of my
code
>
>
Message 3 of 4
Anonymous
in reply to: Anonymous

Hi Frank
thanks for the reply. However I'm not sure how to make it
work.
Why do you setq i to -1? and do I need to place this after ssget has been
selected ?
also (repeat(sslength InnSet) etc is this at the end of the code?


> ENTDEL expects an ENAME as an argument, not a PICKSET. If it's your
> intention to erase everything you selected, you can either feed the
> selection set to the erase command or loop through the set, deleting
> objects one at a time:
>
> (setq i -1)
> (repeat (sslength InnSet)
> (entdel (ssname InnSet (setq i (1+ i))))
> )
Message 4 of 4
Anonymous
in reply to: Anonymous

> Why do you setq i to -1?

Selection sets are 0 based, so the first item in the set has an "Index" of
zero, the second has an "Index" of 1 etc....

> do I need to place this after ssget has been selected ?

Yes.

(setq InnSet (ssget.......))

(setq i -1)
(repeat (sslength InnSet)
(entdel (ssname InnSet (setq i (1+ i))))
)

-Jason

"Kiwi Russ" wrote in message
news:60476D6EB8D19301FDC93E663EA95CA9@in.WebX.maYIadrTaRb...
> Hi Frank
> thanks for the reply. However I'm not sure how to make it
> work.
> Why do you setq i to -1? and do I need to place this after ssget has been
> selected ?
> also (repeat(sslength InnSet) etc is this at the end of the code?
>
>
> > ENTDEL expects an ENAME as an argument, not a PICKSET. If it's your
> > intention to erase everything you selected, you can either feed the
> > selection set to the erase command or loop through the set, deleting
> > objects one at a time:
> >
> > (setq i -1)
> > (repeat (sslength InnSet)
> > (entdel (ssname InnSet (setq i (1+ i))))
> > )
>
>
>

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

Post to forums  

Autodesk Design & Make Report

”Boost