公告版位
我是從事建築的測量放樣工程.......希望能夠與大家一起分享工作的心得及技術....
目前分類:AutoLisp程式 (3)
- Dec 01 Mon 2008 00:45
在AutoCAD裏標圖面座標及匯點至文字檔
- Aug 02 Sat 2008 08:20
CAD高級技巧
- Oct 09 Tue 2007 04:32
在圖上標上座標(x,y)
;DE command will dimension the xy coords of the endpoint of any line
; or arc with leader, with text automatic and inserted as X 0.3426 , Y 6.4356
; or arc with leader, with text automatic and inserted as X 0.3426 , Y 6.4356
(defun c:de ()
(setvar "cmdecho" 0)
(command "osnap" "end")
(setq p1 (getpoint "Select line near endpoint"))
(setq p2 (getpoint p1 "Select cen of Leader"))
(setq px (rtos (nth 0 p1 ) 2 4))
(setq py (rtos (nth 1 p1 ) 2 4))
(setq txt (strcat "x " px " , " "y " py))
(command "dim1" "leader" p1 p2 "" txt)
(setvar "cmdecho" 1)
)
(setvar "cmdecho" 0)
(command "osnap" "end")
(setq p1 (getpoint "Select line near endpoint"))
(setq p2 (getpoint p1 "Select cen of Leader"))
(setq px (rtos (nth 0 p1 ) 2 4))
(setq py (rtos (nth 1 p1 ) 2 4))
(setq txt (strcat "x " px " , " "y " py))
(command "dim1" "leader" p1 p2 "" txt)
(setvar "cmdecho" 1)
)
用(附屬應用程式)中的(記事本)輸入上面的程式....再另存新檔,檔名是DE.LISP

執行 AutoCAD.....
開啟舊檔....
點選(工具)...(載入應用程式)....DE.LISP
在指令列輸入....DE

移動滑鼠......點選線的端點....便會出現X,Y座標
