乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
楼主: Jaap Marchal

[编程交流] Forced delete (embedded) block

[复制链接]

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 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"
回复

使用道具 举报

54

主题

3755

帖子

3583

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
438
发表于 2022-7-6 10:26:31 | 显示全部楼层
All cons is going is recreating a dotted pair list. Why create extra work for yourself?
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 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:
 
  1. ... (if (and (setq ss (ssget "_+.:S" '((0 . "INSERT"))))          (setq ss1 (ssname ss 0))          (setq e (entget ss1)))   (progn     ([color=black]setq Blks (ssget "_x" (list '(0 . "INSERT") (cons 2 (cdr (assoc 2 e))))))[/color][color=black]...[/color]
 
... To that of mine:
 
  1. [color=black]...[/color][color=black](if (and [/color][color=black](setq eName (car (entsel "\nSelect the Block You Wish to Delete: ")))[/color][color=black]        (setq ss (ssget "_x" (list '(0 . "INSERT") (assoc 2 (entget eName))))))[/color]...
 
 
... You will see (appreciate?) the inherent advantage to the latter.
 
Cheers!
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 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
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-6 10:36:24 | 显示全部楼层
 
Yeah.... I should have used it with assoc only without the cons function .
 
Appreciated
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 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.
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 2022-7-6 10:42:41 | 显示全部楼层
 
Great guess .
 
The selected Block was nested to another which caused that message to appear .
 
Appreciated.
 
Tharwat
回复

使用道具 举报

44

主题

3166

帖子

2803

银币

中流砥柱

Rank: 25

铜币
557
发表于 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....
回复

使用道具 举报

63

主题

6297

帖子

6283

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
358
发表于 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
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-7 00:29 , Processed in 0.941125 second(s), 68 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表