用坐标画图后CAD坐标如何在图上自动显示出坐标值
发布网友
发布时间:2022-04-24 20:41
我来回答
共2个回答
热心网友
时间:2023-10-10 09:19
CAD二次开发的插件吧。
有兴趣的话,自己可以学一下CAD二开,想什么样的功能,自己写就是了。。。
热心网友
时间:2023-10-10 09:19
将下面的字符全部复制到记事本里,保存为:**.lsp,在cad里加载该lisp文件,运行命令:PTXT
;;;* PTXT types coordinates and draws points and lines between them
;;;* It uses the current style of points and text with height 0.2 and angle 90
(defun C:PTXT ( / dp1 dp txt)
(setq cmdech (getvar "CMDECHO")) ;Save command echo
(setvar "CMDECHO" 0) ;Turn command echo off
(graphscr)
(repeat 25
(setq
dp1 dp ;Assign variables
dp (getpoint "\nEnter design point: " ) ;Get design point
txt (strcat " " ;Offer default
(rtos (car dp)) "/"
(rtos (+ -000 (cadr dp))) " " )
);setq
(command "_.TEXT" dp "0.2" "90" txt
"_.POINT" DP
);command
(if dp1 (command "_.line" dp1 dp ""))
);repeat
(setvar "CMDECHO" cmdech) ;Restore command echo
(princ) ;Ends program cleanly
);end defun
(defun C:STXT ( / dp1 dp txt)
(setq cmdech (getvar "CMDECHO")) ;Save command echo
(setvar "CMDECHO" 0) ;Turn command echo off
(graphscr)
(repeat 25
(setq
dp1 dp ;Assign variables
dp (getpoint "\nEnter design point: " )
);setq ;Get design point
(if dp1 (setq dp (list (+ (car dp1) (car dp)) (cadr dp))))
(setq
txt (strcat " " ;Offer default
(rtos (car dp)) "/"
(rtos (+ 000 (cadr dp))) " " )
);setq
(command "_.TEXT" dp "0.2" "90" txt
"_.POINT" DP
);command
(if dp1 (command "_.line" dp1 dp ""))
);repeat
(setvar "CMDECHO" cmdech) ;Restore command echo
(princ) ;Ends program cleanly
);end defun
;;;*
;;;* DSN types coordinates and draws lines between them
;;;* It uses the current style of points and text with height 0.2 and angle 90
(defun C:DSN (/ )
(setq cmdech (getvar "CMDECHO")) ;Save command echo
(setvar "CMDECHO" 0) ;Turn command echo off
(graphscr)
(command "_.LAYER" "_M" "D" "_C" "6" "" "")
(setq
lvl (GETREAL "\nEnter level of ditch ")
dp1 (list 12 lvl)
dp2 (list 9 lvl)
dp3 (list 6 (+ 2 lvl))
dp4 (list 3 (+ 2 lvl))
dp5 (list 0 lvl)
dp6 (list -5 lvl)
);setq
(tx dp1 dp1)
(tx dp1 dp2)
(tx dp2 dp3)
(tx dp3 dp4)
(tx dp4 dp5)
(tx dp5 dp6)
(setvar "CMDECHO" cmdech) ;Restore command echo
(princ) ;Ends program cleanly
);end defun
;;;*
(defun tx (dpf dp /)
(setq
txt (strcat ;Offer default
(rtos (car dp)) "/"
(rtos (+ 000 (cadr dp))) " "
)
dpi (list (car dp) (- (cadr dp) 1.0))
);setq
(command "_.TEXT" "_R" dp "0.2" "90" txt
"_.line" dpi dp ""
);command
(if dpf (command "_.line" dpf dp ""))
(princ)
);defun
;;;* DSG types coordinates and draws lines between them
;;;* It uses the current style of points and text with height 0.2 and angle 90
(defun C:DSG ( / dp dp1 dp2 txt)
(setq cmdech (getvar "CMDECHO")) ;Save command echo
(setvar "CMDECHO" 0) ;Turn command echo off
(graphscr)
(command "_.LAYER" "_M" "D" "_C" "6" "" "")
(repeat 25
(setq
dp1 dp ;Assign variables
dp (getpoint "\nEnter design point: " ) ;Get design point
txt (strcat " " ;Offer default
(rtos (car dp)) "/"
(rtos (+ 000 (cadr dp))) " "
)
dp2 (list (- (car dp) 0) (- (cadr dp) 1.5))
);setq
(command "_.TEXT" "_R" dp "0.2" "90" txt
"_.line" dp2 dp ""
);command
(if dp1 (command "_.line" dp1 dp ""))
);repeat
(setvar "CMDECHO" cmdech) ;Restore command echo
(princ) ;Ends program cleanly
);end defun
(defun C:ARE ()
(command "_.AREA" "E" "L")
);DEFUN;;;*
(defun C:LTL ()
(command "_.LINETYPE" "_S" "BYLAYER" "")
);DEFUN