CAD座標資料批次匯出小工具 (defun c:md() (setvar "cmdecho" 0) (COMMAND ".UNDO" "BE") (command "-units" "2" "3" "2" "3" "" "") (setq fp (open "d:/樁號座標值.xls" "a") s (getvar "cmdecho") n (getint "\n請輸入總樁數! ")) (princ "樁號" fp)(princ "\t" fp) (princ "X座標值" fp)(princ "\t" fp) (princ "Y座標值" fp)(princ "\n" fp) (repeat n (setq k (getstring "\n輸入樁號(如:K1)!") p (getpoint "\n選取節點!") x (strcat "X=" (rtos (nth 0 p))) y (strcat "Y=" (rtos (nth 1 p))))(princ k fp)(princ "\t" fp)(princ x fp)(princ "\t" fp)(princ y fp)(princ "\n" fp)) (close fp) (setvar "cmdecho" s)) (princ "\n提示:輸入 MD 命令來執行本程式!") (princ)1、 開啟記事本,貼上以上程式碼,然後儲存成 md.lsp2、 開啟CAD並載入這個小程式(在命令列輸入appload,選擇載入md.lsp程式),將md.lsp複製在support資料夾下後可自動載入。3、 輸入md執行命令,輸入樁數,再輸入樁號,再選擇點,完成後,儲存CAD檔案,關閉CAD,開啟D盤你就會看到生成一個檔案“樁號座標值.xls”的Excel檔案,開啟,如下格式樁號 X座標值 Y座標值k1 X=1073.205 Y=1028.341k2 X=2193.676 Y=922.327k3 X=1752.278 Y=595.802樁號 X座標值 Y座標值1 X=877.972 Y=1257.3332 X=2360.883 Y=1257.3333 X=1578.266 Y=281.999
CAD座標資料批次匯出小工具 (defun c:md() (setvar "cmdecho" 0) (COMMAND ".UNDO" "BE") (command "-units" "2" "3" "2" "3" "" "") (setq fp (open "d:/樁號座標值.xls" "a") s (getvar "cmdecho") n (getint "\n請輸入總樁數! ")) (princ "樁號" fp)(princ "\t" fp) (princ "X座標值" fp)(princ "\t" fp) (princ "Y座標值" fp)(princ "\n" fp) (repeat n (setq k (getstring "\n輸入樁號(如:K1)!") p (getpoint "\n選取節點!") x (strcat "X=" (rtos (nth 0 p))) y (strcat "Y=" (rtos (nth 1 p))))(princ k fp)(princ "\t" fp)(princ x fp)(princ "\t" fp)(princ y fp)(princ "\n" fp)) (close fp) (setvar "cmdecho" s)) (princ "\n提示:輸入 MD 命令來執行本程式!") (princ)1、 開啟記事本,貼上以上程式碼,然後儲存成 md.lsp2、 開啟CAD並載入這個小程式(在命令列輸入appload,選擇載入md.lsp程式),將md.lsp複製在support資料夾下後可自動載入。3、 輸入md執行命令,輸入樁數,再輸入樁號,再選擇點,完成後,儲存CAD檔案,關閉CAD,開啟D盤你就會看到生成一個檔案“樁號座標值.xls”的Excel檔案,開啟,如下格式樁號 X座標值 Y座標值k1 X=1073.205 Y=1028.341k2 X=2193.676 Y=922.327k3 X=1752.278 Y=595.802樁號 X座標值 Y座標值1 X=877.972 Y=1257.3332 X=2360.883 Y=1257.3333 X=1578.266 Y=281.999