More specifically, they yield the same result... that is what's important.
I think not... I'm not a fan of doing extra work for the same result.
Edit:
How's the old saying go... "Brevity is the Soul of Wit" All cons is going is recreating a dotted pair list. Why create extra work for yourself?
That's great, Tharwat... but did you understand the point being made?
I think that when you (genuinely) compare the amount of code/work in yours:
... (if (and (setq ss (ssget "_+.:S" '((0 . "INSERT")))) (setq ss1 (ssname ss 0)) (setq e (entget ss1))) (progn (setq Blks (ssget "_x" (list '(0 . "INSERT") (cons 2 (cdr (assoc 2 e))))))...
... To that of mine:
...(if (and (setq eName (car (entsel "\nSelect the Block You Wish to Delete: "))) (setq ss (ssget "_x" (list '(0 . "INSERT") (assoc 2 (entget eName))))))...
... You will see (appreciate?) the inherent advantage to the latter.
Cheers!
Yes Renderman .
That's what I intended to code at the beginning of the first post and I do not know why I changed my mind with it to ssget .
Here is the message that I have received while invoking your codes , I do not why .
Many thanks
Yeah.... I should have used it with assoc only without the cons function .
Appreciated </blockquote>
Interesting... which line breaks in VLIDE?
First guess would be the line that deletes the block reference... the error suggests that the block exists elsewhere, perhaps nested inside of another block?
Admittedly, my code does not handle nested blocks, only primary.
Great guess .
The selected Block was nested to another which caused that message to appear .
Appreciated.
Tharwat
Ohhhh! That's what the OP meant by '(embedded)'.
I'm busy at the moment, but will try to revist the original request, given this late revelation....
We have been dancing out of the ring since the first post .
Although my codes would escape slowly.
Thanks
页:
1
[2]