文字原位黏贴应该怎么写?
想实现文字阴影的效果,现在文字移动了,但是原来的文字要黏贴到原坐标才行,要怎么写?(defun c:wzyy ()
(setq ssg (ssget '((0 . "*TEXT"))));移动文字
(sssetfirst nil ssg )
(command "MOVE" ssg "" "D""0.1,0,0");"0.1,0,0"
(princ)
)
spp_wall 发表于 2022-9-8 09:50
效果很好 可惜没有函数 模仿院长写的 但是第一次运行只复制 第二次就执行偏移 第三次才执行改颜色,是什 ...
(defun c:tt ()
"模拟文本阴影"
(if (setq ss (ssget '((0 . "*TEXT"))))
(progn
(command "undo" "be")
(setvar "osmode" 0)
(setq i -1)
(while (setq s1 (ssname ss (setq i (1+ i))))
(command "copy" s1 "" '(0 0) '(0 0))
(setq s2 (entlast))
(command "MOVE" s2 "" '(0 0) '(-5 5))
(command "chprop" s2 "" "c" "2" "")
(command "chprop" s1 "" "c" "1" "")
)
(command "regen")
(command "undo" "e")
)
)
(princ)
) 原位复制一个再移动 (defun c:wzyy ()
(setq ssg (ssget '((0 . "*TEXT"))));移动文字
(setq ssg2
(command "copy" ssg"" "d" "0, 0, 0" "" ))
(sssetfirst nil ssg2 )
(command "MOVE" ssg2 "" "D""0.1,0,0");"0.1,0,0"
(command "change" ssg2 "" "p" "c" "2" "")
(princ)
)
好像可以,但是后面偏移后颜色改成黄色好像不行! 文字原位黏贴
(defun c:cpz ( / s )
(if (setq s (ssget)) (command "_.copybase" "_non" '(0 0) s ""))
(princ)
)
(defun c:pcz ( )
(command "_.pasteclip" "_non" '(0 0))
(princ)
)
看蒙了,哪跟哪啊? 本帖最后由 spp_wall 于 2022-9-8 10:37 编辑
xyp1964 发表于 2022-9-7 19:47
效果很好 可惜没有函数 模仿院长写的 但是第一次运行只复制 第二次就执行偏移 第三次才执行改颜色,是什么原因呢?(defun c:wzyy ()
(if (setq ss (ssget '((0 . "*TEXT"))))
(progn
(setq s0 (entlast))
(command "copy" ss"" "d" "0, 0, 0" "" )
(setq ss1 (command "MOVE" s0 "" "D""0.1,0,0"));"0.1,0,0")
(setq ss2 (command "change" s0"" "p" "c" "2" ""))
(command "regen")
)
(princ)
)
)
(command "copy" (ssget '((0 . "*text"))) "" "non" '(0 0) "non"'(0 0) "move" "p" "" "non" '(0 0) "non" '(0.1 0) "change" "p" "" "p" "c" "2" "" "regen") 根据文字高度判断一下移动距离好点
页:
[1]
2