发布于:2011-05-13 20:10:13
来自:建筑设计/CAD下载及教程
[复制转发]
这段代码不能跟随鼠标复制,每次点击鼠标都在原地复制[code];****************************************************数字递增复制
(defun c:TC (/ E ENEW NV P S)
(princ "\n 数字递增复制")
(if (and (setq e (car (entsel "\nSelect Text: ")))
(setq e (vlax-ename->vla-object e))
(or (= "AcDbText" (vla-get-ObjectName e))
(= "AcDbMText" (vla-get-ObjectName e))
)
)
(progn
(setq s (vla-get-TextString e))
(if (null (setq nv (getreal (strcat "\nNew value:" "<40>"))))
(setq nv 40)
)
(princ "\nCopy to: ")
(while (setq p (getpoint))
(setq enew (vla-copy e))
(vla-put-textstring enew (setq s (rtos (+ (atof s) nv) 2)))
(vla-put-InsertionPoint enew (vlax-3d-point p))
)
)
(princ "\n选中的不是文本或没有选择到实体.")
)
(princ)
)[/code]
全部回复(1 )
只看楼主 我来说两句 抢板凳回复 举报