木头人的(defun c:TT ()
(setq ss (ssget))
(if (not ss)
(progn
(princ "\n未选择任何实体。")
(exit)
)
)
(setq pt0 (getpoint "\n选择基点:"))
(setq pt1 (getpoint pt0 "\n选择终点:"))
(command "_.copy" ss "" pt0 pt1)
(setq ss1 entlast)
(command "_.scale" "_l" "" pt1 10)
(setq last_text (entlast)) ; 获取最后创建的实体的实体名
(setq ob (vlax-ename->vla-object last_text)) ; 将最后创建的实体转换为 VLA 对象
(vlax-put-property ob 'StyleName "宋体")
(princ)
) 664571221 发表于 2024-4-12 09:16
(defun c:TT ()
(setq ss (ssget))
(if (not ss)
小星的(defun c:FZFD (/ ss pt0 pt1 ss1)
(setq ss (ssget))
(if (not ss)
(progn
(princ "\n未选择任何实体。")
(exit)
)
)
(setq pt0 (getpoint "\n选择基点:"))
(setq pt1 (getpoint pt0 "\n选择终点:"))
(command "_.copy" ss "" pt0 pt1)
(setq ss1 (entlast))
(command "_.scale" "_l" "" pt1 10)
(command "CHANGE" ss1 "" "p" "c" "1" "")
(princ)
) 664571221 发表于 2024-4-12 09:17
小星的(defun c:FZFD (/ ss pt0 pt1 ss1)
(setq ss (ssget))
(if (not ss)
(defun c:TT (/ ss pt0 pt1 ss1)
(vl-load-com)
(setq ThisDrawing(vla-get-activedocument (vlax-get-acad-object)))
(Setq TextStyles(vla-get-TextStyles ThisDrawing))
(Setq TextStyle(vla-add TextStyles "新文字样式"))
(vla-SetFont TextStyle "宋体" :vlax-false :vlax-false 1 0)
(setq ss (ssget))
(if (not ss)
(progn
(princ "\n未选择任何实体。")
(exit)
)
)
(setq pt0 (getpoint "\n选择基点:"))
(setq pt1 (getpoint pt0 "\n选择终点:"))
(command "_.copy" ss "" pt0 pt1)
(setq ss1 (entlast))
(command "_.scale" "_l" "" pt1 2)
(command "CHANGE" ss1 "" "p" "c" "1" "")
(setq last_text (entlast)) ; 获取最后创建的实体的实体名
(setq ob (vlax-ename->vla-object last_text)) ; 将最后创建的实体转换为 VLA 对象
(vlax-put-property ob 'StyleName "宋体")
(princ)
) 664571221 发表于 2024-4-14 10:41
(defun c:TT (/ ss pt0 pt1 ss1)
(vl-load-com)
(setq ThisDrawing(vla-get-activedocument (vlax ...
Z大的代码
(defun c:TT ()
(setq ss (ssget))
(if (not ss) (progn
(princ "\n未选择任何实体。")
(exit)
))
(setq pt0 (getpoint "\n选择基点:"))
(setq pt1 (getpoint pt0 "\n选择终点:"))
(command "_.copy" ss "" pt0 pt1)
; (setq ss1 entlast)
(command "_.scale" "_l" "" pt1 10)
(setq last_text (entlast)) ; 获取最后创建的实体的实体名
(setq ob (vlax-ename->vla-object last_text)) ; 将最后创建的实体转换为 VLA 对象
(vlax-put-property ob 'StyleName "宋体")
(vlax-put-property ob 'Color "1")
(princ)
)
页:
1
[2]