求一个cad的lisp程序
程序功能很简单,就是在cad里输入命令em,然后选择一些文字,回车后让这些文字自动删除“,”(逗号)之后的任何文字和数字,包括“,”(逗号)本身。谢谢!...
程序功能很简单,就是在cad里输入命令em,然后选择一些文字,回车后让这些文字自动删除“,”(逗号)之后的任何文字和数字,包括“,”(逗号)本身。谢谢!
展开
2个回答
展开全部
;请试用以下程序
;by DnBc
(defun c:scdh()
(setq cm (getvar "cmdecho")) (setvar "cmdecho" 0)
(command "_undo" "be")
(while (setq ssa (ssget '((0 . "text"))))
(setq i 0 n (sslength ssa))
(repeat n
(setq dxf (entget (ssname ssa i))
zfc (cdr (assoc 1 dxf))
i (1+ i)
)
(if (or (> (setq n (vl-string-search "," zfc)) 0)
(> (setq n (vl-string-search "," zfc)) 0)
)
(progn
(setq zfc (substr zfc 1 n)
dxf (subst (cons 1 zfc) (assoc 1 dxf) dxf)
)
(entmod dxf)
)
)
)
)
(command "_undo" "e")
(setvar "cmdecho" cm)
(princ)
)
;by DnBc
(defun c:scdh()
(setq cm (getvar "cmdecho")) (setvar "cmdecho" 0)
(command "_undo" "be")
(while (setq ssa (ssget '((0 . "text"))))
(setq i 0 n (sslength ssa))
(repeat n
(setq dxf (entget (ssname ssa i))
zfc (cdr (assoc 1 dxf))
i (1+ i)
)
(if (or (> (setq n (vl-string-search "," zfc)) 0)
(> (setq n (vl-string-search "," zfc)) 0)
)
(progn
(setq zfc (substr zfc 1 n)
dxf (subst (cons 1 zfc) (assoc 1 dxf) dxf)
)
(entmod dxf)
)
)
)
)
(command "_undo" "e")
(setvar "cmdecho" cm)
(princ)
)
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
展开全部
;请试用以下程序
;by DnBc
(defun c:jctc()
(vl-load-com)
(if (and (setq tcm (getstring "\n图层名:"))
(/= tcm "")
)
(if (= (tblsearch "layer" tcm) nil)
(command "_layer" "n" tcm "")
(progn
(setq obj (vlax-ename->vla-object (tblobjname "layer" tcm)))
(vlax-put obj "layeron" (* -1 (1+ (vlax-get obj "layeron"))))
)
)
)
(princ)
)
;by DnBc
(defun c:jctc()
(vl-load-com)
(if (and (setq tcm (getstring "\n图层名:"))
(/= tcm "")
)
(if (= (tblsearch "layer" tcm) nil)
(command "_layer" "n" tcm "")
(progn
(setq obj (vlax-ename->vla-object (tblobjname "layer" tcm)))
(vlax-put obj "layeron" (* -1 (1+ (vlax-get obj "layeron"))))
)
)
)
(princ)
)
追问
你这个不对吧,看上去像是图层类的程序代码,刚才试用了下也没有我想要的功能啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询