乐筑天下

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

[编程交流] Found a lisp from Tharwat (blo

[复制链接]

12

主题

56

帖子

46

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
58
发表于 2022-7-5 15:21:48 | 显示全部楼层 |阅读模式
I found a lisp from Tharwat and as below Web(It is good)
Have any way let block quickly and it don't need to select point?
There are 1000 texts need to create block.
 
 
 
  1. ; Quick Block; Creates a block instantly out of the objects that you select; Found at [url]http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/Quick-block/td-p/3454228[/url](defun c:QB (/ selectionset insertionpoint number Blockname);;; Tharwat 11. May. 2012 ;;(if (and (setq selectionset (ssget "_:L"))(setq insertionpoint (getpoint "\n Specify insertion point :")))(progn(setq number 1Blockname (strcat "MyBlock" (itoa number)))(while (tblsearch "BLOCK" Blockname)(setq Blockname(strcat "MyBlock" (itoa (setq number (1+ number))))))(command "_.-Block" Blockname insertionpoint selectionset "")(command "_.-insert" Blockname insertionpoint "" "" ""))(princ))(princ))
回复

使用道具 举报

13

主题

146

帖子

136

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
62
发表于 2022-7-5 15:26:16 | 显示全部楼层
Here's one I use. It doesn't require an insertion point,  but it makes anonymous blocks, which may not be what you want because they do not show in Autocad's Block Editor.
 
Steve
 
  1. ;;; MAKES ANONYMOUS BLOCKS;;;(princ "\n This code is provided Unscramnbled - for free - given that it is not altered")(princ "\n Thanks for your understanding, www.xordesign.com ")(princ "\n Type TBLOCK to start ")(defun c:TBLOCK (/ sset tell ent ent_get entu ent_getu blk)       (princ "\n Select objects to group into anonymous Block: ")       (setq sset (ssget))       (if sset (progn            (entmake (list                       '(0 . "BLOCK")                      '(2 . "*U")                      '(70 . 1)                      '(10  0.0 0.0 0.0)))            (setq tell 0)            (setq ent (ssname sset tell))            (while ent              (setq ent_get (entget ent))              (if (/= (cdr (assoc 0 ent_get)) "POLYLINE")                  (progn                     (setq ent_getu (cdr ent_get))                     (entdel ent)                     (entmake ent_getu))                  (progn                    (setq entu ent                          ent_getu (cdr ent_get))                    (while (/= (cdr (assoc 0 ent_getu)) "SEQEND")                     (setq ent_getu (cdr (entget entu)))                     (entmake ent_getu)                     (setq entu (entnext entu))                     );while                     (entdel ent)                                     )              );if              (setq tell (+ tell 1))              (setq ent (ssname sset tell))            )                   (setq blk (entmake (list '(0 . "ENDBLK"))))            (entmake (list '(0 . "INSERT")                            (cons 2 blk)                            '(10 0.0 0.0 0.0)))           );progn       );if     (princ "\n Anonymous block created. Explode to ungroup")       (princ))                    (princ)
回复

使用道具 举报

12

主题

56

帖子

46

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
58
发表于 2022-7-5 15:30:45 | 显示全部楼层
Hi Steve
Thanks
For 1000 texts
Can it have 1000 points?The pionts set on every text centor.
 
 
回复

使用道具 举报

2

主题

261

帖子

20

银币

初来乍到

Rank: 1

铜币
8
发表于 2022-7-5 15:34:05 | 显示全部楼层
Rain0923
See attachment, this is a program, not a lisp.
Unzip the archive, open dwg file, start program, click Start.
TextToBlock.zip
回复

使用道具 举报

13

主题

146

帖子

136

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
62
发表于 2022-7-5 15:37:58 | 显示全部楼层
Rain0923,
My understanding was that you wanted to make a single block consisting of all texts in your drawing.
If your objective is to turn each line of text in a drawing into its own separate block, the TBLOCK program I suggested is not the tool for that job.
 
Steve
回复

使用道具 举报

12

主题

56

帖子

46

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
58
发表于 2022-7-5 15:40:04 | 显示全部楼层
Thank you for your help,but this program can't download in my company.
Still thank you!!
 
回复

使用道具 举报

12

主题

56

帖子

46

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
58
发表于 2022-7-5 15:46:41 | 显示全部楼层
Still thank you!!thank you!!
 
回复

使用道具 举报

2

主题

261

帖子

20

银币

初来乍到

Rank: 1

铜币
8
发表于 2022-7-5 15:49:25 | 显示全部楼层
Why?
Did you watch it?
It does not need to be installed.
回复

使用道具 举报

12

主题

56

帖子

46

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
58
发表于 2022-7-5 15:53:02 | 显示全部楼层
Yes watched it at home.
But I just can download file(EX:pdf, doc, xls, ppt, txt)
For exe file,I can't download in my company.
Thank you very much
Thank you very much
Thank you very much
 
回复

使用道具 举报

2

主题

261

帖子

20

银币

初来乍到

Rank: 1

铜币
8
发表于 2022-7-5 15:54:44 | 显示全部楼层
Flash drive
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

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

GMT+8, 2025-3-14 03:32 , Processed in 0.493424 second(s), 72 queries .

© 2020-2025 乐筑天下

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