文本为轮廓线

关键步骤:找到文本中心并水平镜像;wmfout、wmfin(2倍),以其中心再镜像,并移回原中心和打碎。

 
复制代码
 1 (load "xyp_lib")
 2 ;|加载通用函数(可在签名栏直接下载)
 3 如果已经下载xyp_lib并放到搜索路径下可以不再下载!
 4 利用以下任何一种方式(首选第一种)即可加载和运行通用函数内的所有子程序:
 51·在acad.lsp中增加(load"xyp_lib")
 62·在每个程序内增加(load"xyp_lib")
 73·在command下,输入(load"xyp_lib")
 84·在菜单.mnl中增加(load"xyp_lib")
 95·将xyp_lib.vlx文件直接拽到cad屏幕
10 [COLOR=red] ★通用函数下载地址:[/COLOR]
11 [url]http://www.xdcad.net/forum/attachment.php?s=&postid=1606661[/url]
12 |;
13 
14 ;;;炸碎文字(变成线)
15 (Defun c:test ()
16   (CMDLA0)
17   (SetVar "MIRRTEXT" 1)
18   (PrinC "\n要分解的文字行: ")
19   (setq        s1  (car (usel1 0 "TEXT" "TEXT文本"))
20         pt1 (xyp-get-MinMaxPoint s1 0)
21         pt2 (xyp-get-MinMaxPoint s1 1)
22         pt  (xyp-get-MidPoint pt1 pt2)
23         pt3 (polar pt (* pi 0.5) 100)
24   )
25   (setvar "osmode" 0)
26   (Command "mirror" s1 "" pt pt3 "y")
27   (command "zoom" "w" pt1 pt2)
28   (command "wmfout" "TEXTWMF" s1 "" "erase" s1 "")
29   (command "wmfin" "TEXTWMF" pt "2" "" "")
30   (setq s1 (EntLast))
31   (command "mirror" s1 "" pt pt3 "y")
32   (setq        pt1 (xyp-get-MinMaxPoint s1 0)
33         pt2 (xyp-get-MinMaxPoint s1 1)
34         pt0 (xyp-get-MidPoint pt1 pt2)
35   )
36   (command "move" s1 "" pt0 pt)
37   (command "explode" s1 "")
38   (setvar "MIRRTEXT" 0)
39   (CMDLA1)
40 )
复制代码

功能:批量炸碎文字变成线

 
复制代码
;;;批量炸碎文字(变成线)
(Defun c:test ()
  (CMDLA0)
  (SetVar "MIRRTEXT" 1)
  (PrinC "\n选择要分解的文字 : ")
  (setq        ss (ssget '((0 . "TEXT")))
        i  -1
  )
  (while (setq s1 (ssname ss (setq i (1+ i))))
    (setq pt1 (xyp-get-MinMaxPoint s1 0)
          pt2 (xyp-get-MinMaxPoint s1 1)
          pt  (xyp-get-MidPoint pt1 pt2)
          pt3 (polar pt (* pi 0.5) 100)
    )
    (setvar "osmode" 0)
    (Command "mirror" s1 "" pt pt3 "y")
    (command "zoom" "w" pt1 pt2)
    (command "wmfout" "TEXTWMF" s1 "" "erase" s1 "")
    (command "wmfin" "TEXTWMF" pt "2" "" "")
    (setq s1 (EntLast))
    (command "mirror" s1 "" pt pt3 "y")
    (setq pt1 (xyp-get-MinMaxPoint s1 0)
          pt2 (xyp-get-MinMaxPoint s1 1)
          pt0 (xyp-get-MidPoint pt1 pt2)
    )
    (command "move" s1 "" pt0 pt)
    (command "explode" s1 "")
  )
  (setvar "MIRRTEXT" 0)
  (CMDLA1)
)
复制代码

 

[FONT=courier new](load "xyp_lib");|加载通用函数(可在签名栏直接下载)如果已经下载xyp_lib并放到搜索路径下可以不再下载!利用以下任何一种方式(首选第一种)即可加载和运行通用函数内的所有子程序:★1·在acad.lsp中增加(load"xyp_lib")■2·在每个程序内增加(load"xyp_lib")■3·在command下,输入(load"xyp_lib")■4·在菜单.mnl中增加(load"xyp_lib")■5·将xyp_lib.vlx文件直接拽到cad屏幕[COLOR=red] ★通用函数下载地址:[/COLOR][url]http://www.xdcad.net/forum/attachment.php?s=&postid=1606661[/url]|;;;;炸碎文字(变成线)(Defun c:test ()  (CMDLA0)  (SetVar "MIRRTEXT" 1)  (PrinC "\n要分解的文字行: ")  (setq        s1  (car (usel1 0 "TEXT" "TEXT文本"))        pt1 (xyp-get-MinMaxPoint s1 0)        pt2 (xyp-get-MinMaxPoint s1 1)        pt  (xyp-get-MidPoint pt1 pt2)        pt3 (polar pt (* pi 0.5) 100)  )  (setvar "osmode" 0)  (Command "mirror" s1 "" pt pt3 "y")  (command "zoom" "w" pt1 pt2)  (command "wmfout" "TEXTWMF" s1 "" "erase" s1 "")  (command "wmfin" "TEXTWMF" pt "2" "" "")  (setq s1 (EntLast))  (command "mirror" s1 "" pt pt3 "y")  (setq        pt1 (xyp-get-MinMaxPoint s1 0)        pt2 (xyp-get-MinMaxPoint s1 1)        pt0 (xyp-get-MidPoint pt1 pt2)  )  (command "move" s1 "" pt0 pt)  (command "explode" s1 "")  (setvar "MIRRTEXT" 0)  (CMDLA1))[/FONT]

posted @   unicornsir  阅读(282)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示