BlackBox 发表于 2022-7-6 10:21:32

 
 
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"

alanjt 发表于 2022-7-6 10:26:31

All cons is going is recreating a dotted pair list. Why create extra work for yourself?

BlackBox 发表于 2022-7-6 10:28:29

 
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!

Tharwat 发表于 2022-7-6 10:33:15

 
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

Tharwat 发表于 2022-7-6 10:36:24

 
Yeah.... I should have used it with assoc only without the cons function .
 
Appreciated

BlackBox 发表于 2022-7-6 10:38:48

</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.

Tharwat 发表于 2022-7-6 10:42:41

 
Great guess .
 
The selected Block was nested to another which caused that message to appear .
 
Appreciated.
 
Tharwat

BlackBox 发表于 2022-7-6 10:46:34

 
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....

Tharwat 发表于 2022-7-6 10:49:31

 
We have been dancing out of the ring since the first post .
 
Although my codes would escape slowly.
 
Thanks
页: 1 [2]
查看完整版本: Forced delete (embedded) block