做了几个画云线的插件,觉得还是参照文字比例修改比较好
本帖最后由 WWYYBB1015 于 2020-5-5 15:21 编辑(defun c:RED(/ x sc pt1)
(setvar "cmdecho" 0)
(defun dxf(code e) (cdr (assoc code (entget e))))
(setq x nil)
(princ "\n请选择单行文字")
(while (= x nil)
(setq x (= (dxf 0 (setq ent (car (entsel "")))) "TEXT"))
(princ "\n未选中单行文字,请重新选择"))
(if (= x T)
(progn
(setq sc (dxf 40 ent))
(command "rectang"
(setq pt1 (getpoint "\n指定第一个角点"))
(getcorner pt1 "\n指定另一个角点"))
(command "revcloud" "a" sc sc "" (entlast) "")))
(princ))
;;文字和云线均与图框成比例关系,此处选择参照文字来确定比例
;;云线弧长默认与文字自高相等,比例不满意可以把sc修改为(* sc k),k为自定比例系数
局限性比较大 已经重发新帖 改为新的内容了
Thank you, though It's not practical ^^
Thank you, 修改一下,不选择文字,跳过后,默认上次选择过的文字值,这样更人性化操作 alexmai 发表于 2019-11-2 19:21
修改一下,不选择文字,跳过后,默认上次选择过的文字值,这样更人性化操作
可以考虑下,有时间再写,以前做过手动输入比例的 WWYYBB1015 发表于 2019-11-2 22:33
可以考虑下,有时间再写,以前做过手动输入比例的
给你参考一下
;* 记忆功能子程序
(defun uint (bit kwd msg def / inp)
(if def ;test for a default
(setq msg (strcat "\n >> " msg " < " (itoa def) " >: ") ;string'em with default
bit (* 2 (fix (/ bit 2)));a default and no null bit code conflict so
) ;this reduces bit by 1 if odd, to allow null
(if (= " " (substr msg (strlen msg) 1)) ;no def, if last char is space
(setq msg (strcat "\n >> " (substr msg 1 (1- (strlen msg))) " : ")) ;then strip space
(setq msg (strcat "\n >> " msg " : ")) ;else msg OK
) );if,if
(initget bit kwd)
(setq inp (getint msg)) ;use the GETINT function
(if inp inp def) ;compare the results, return appropriate value
);defun
;;改颜色-带记忆
(defun c:33()
(setq ss (ssget))
(initget 1)
(setq cnt (uint 7 "" "颜色" *Cnt*)
*Cnt* cnt
)
(command "_chprop" ss "" "c" cnt "")
(princ)
) 谢谢 我以前也考虑很久 没什么思路 谢谢分享!!
页:
[1]