Nhờ hoàn thiện lisp phun điểm mia địa chính ra Autocad
Em thấy cái lisp của anh toiyeuviet nam rất đơn giản về cách thực hiện, nhờ các các anh giúp sửa giúp em để khi mình chỉ cần ghi tọa độ 2 điểm GPS1 và GPS2 như file số liệu em gửi kèm theo và phun điểm mia bằng gõ lệnh PDM -> nhập mẫu số tỉ lệ: gõ 1000 -> tìm file solieu -> là phun điểm mia ra giống như hình vẽ kèm theo được không ạ! Chỉ cần liệt kê tọa độ trạm máy và điểm định hướng (giống như dùng chương trình chitietwin của thầy Trần Trung Anh chỉ cần liệt kê tọa độ trạm máy và điểm định hướng là tự vẽ lưới các trạm trong khu đo).
mong các anh giúp em với nhé vì nếu thành công thì công đoạn sẽ đơn giản mà không phải phức tạp và nhiều file rác trong khâu xử lý số liệu nữa! cảm ơn các anh trước nhé!
------------------------------------------------------------------------------------------------------------------------------------------------------------------
;******chuong trinh phun diem mia cho file duoc che bien tu may TOPCON 223**********
; DUNG CHO BAN DO DIA CHINH *
;* TR DCII-04 1014424.593 516275.846 *
;* TR DCII-07 1014339.861 516213.914 *
;* TR DCII-03 1014491.054 516180.297 *
;* TR DCII-06 1014670.141 516433.592 *
;* TR DCTI-04 *
;* DH DCII-03 *
;* 1 355.1447 66.896 *
;* 2 355.1519 47.576 *
;* 3 1.4545 48.375 *
;************************************************************************
(defun c:pdm (/ tam ms PR FN thunhat
tentram caodotram xtram ytram htram
tentrammay tendh
)
(bdau)
(setq tam ())
(setq ms (getreal "Nhap vao mau so ty le : "))
(setq
FN (getfiled "NhËp file nguån : "
""
""
4
)
)
(progn
(command "-osnap" "")
(setvar "cmdecho" 0)
(setvar "luprec" 8)
(setvar "pdmode" 0)
(command "-layer" "m" "diem" "c" "red" "" "")
; (command "-layer" "m" "caodo" "c" "cyan" "" "")
(command "-layer" "m" "sothutu" "c" "magenta" "" "")
(command "-layer" "m" "khongche" "c" "red" "" "")
(setq st (/ ms 1000))
(setq st1 st)
(command "-style" "mota" "txt.shx" st1 "1" "0" "n" "n" "n")
(setq FN (open FN "r"))
(while (and (setq PR (read-line FN)) (/= PR ""))
(progn
(setq PR (strcat "(" PR ")"))
(setq PR (read PR))
(setq thunhat (nth 0 PR))
(if
(numberp thunhat)
(gapsoA)
(gaptramA)
)
) ;end progn
) ;end while
) ;end progn
;;;;ket thuc viet lenh
(close FN)
(command "zoom" "e")
(kthuc)
(princ "\nVAY LA XONG!)*****")
(princ)
)
(defun gaptramA (/ x y)
(setq thunhat (convtostr thunhat))
(if (= thunhat "TR")
(progn
(setq ktra (nth 3 PR))
(if (/= ktra nil) ;GAP TRAM CHUA TOA DO GOC
(progn
(setq tentram (convtostr (nth 1 PR)))
(setq Y (nth 2 PR))
(setq X ktra)
; (setq h (nth 4 PR))
(setq tam (append tam (list (list tentram x y ))))
) ;GAP TRAM DO THUC TE
(progn
(setq tentrammay (convtostr (nth 1 PR)))
; (if (/= (nth 2 PR) nil)
; (setq caodotram (nth 2 PR))
; (setq caodotram 0)
; )
(laytdgoc tentrammay)
(setq tdtram1 (list (+ xtram (* 2 st)) ytram ))
(setq xxtram xtram)
(setq yytram ytram)
(setq tdtram (list xtram ytram))
(command "-layer" "s" "khongche" "")
;(command "point" tdtram)
(command "insert" "cdkc" tdtram st st "")
(setq sss (strlen tentrammay))
(setq tdtram2 (list (+ xtram (* 2 st) );(* (/ sss 2) st))
(- ytram (* 0.65 st))
)
)
; (command "insert"
; "l"
; tdtram1
; (* st sss)
; (* st sss)
; ""
; )
(command "-style"
"mota"
"txt.shx"
st
"1"
"0"
"n"
"n"
"n"
)
(command "text" "j" "bl" tdtram1 "" tentrammay)
(command "-style" "mota" "txt.shx" st1 "1" "0" "n" "n" "n")
; (command "-layer" "s" "khongche" "")
; (command "text" "j" "tl" tdtram2 "" (rtos htram 2 2))
)
)
) ;end progn
(if (= thunhat "DH") ;else
(progn
(setq tendh (convtostr (nth 1 PR)))
(laytdgoc tendh)
(setq tddh (list xtram ytram ))
(setq tddh1 (list (+ xtram (* 2 st)) ytram ))
(command "-layer" "s" "khongche" "")
(command "insert" "cdkc" tddh st st "")
;(command "point" tddh)
(setq sss (strlen tendh))
(setq tddh2 (list (+ xtram (* 2 st)); (* (/ sss 2) st))
(- ytram (* 0.65 st))
)
)
;(command "insert"
; "l"
; tddh1
; (* st sss)
; (* st sss)
; ""
<img src='https://www.cadviet.com/forum/public/style_emoticons/<#EMO_DIR#>/wink.png' class='bbc_emoticon' alt=';)' />
(command "-style"
"mota"
"txt.shx"
st
"1"
"0"
"n"
"n"
"n"
)
(command "text" "j" "bl" tddh1 "" tendh)
(command "-style" "mota" "txt.shx" st1 "1" "0" "n" "n" "n")
; (command "-layer" "s" "khongche" "")
; (command "text" "j" "tl" tddh2 "" (rtos htram 2 1))
)
)
)
)
(defun gapsoA (/ gocbang kc goctd tdx tdy tdz td dentah)
(setq gocbang (nth 1 PR))
(setq kc (nth 2 PR))
; (setq dentah (nth 3 PR))
(setq gocbang (dpgtod gocbang))
(setq gocbang (- 360 gocbang))
(setq gocbang (+ (/ (* gocbang pi) 180) (angle tdtram tddh)))
(setq tdX (+ xxtram (* kc (cos gocbang))))
(setq tdY (+ yytram (* kc (sin gocbang))))
; (if (/= dentah nil)
; (setq tdz (+ caodotram (nth 2 tdtram) dentah))
; (setq tdz 0)
; )
(setq td (list tdx tdy))
(setq td1 (list (+ tdx (* 0.5 st)) (+ tdy (* 0.3 st)) ))
(setq td2 (list (+ tdx (* 0.5 st)) (- tdy (* 0.3 st)) ))
(command "-layer" "s" "diem" "")
;(command "insert" "cdc" td st st "")
(command "point" td)
(command "-style"
"mota"
"txt.shx"
(* st 2)
"1"
"0"
"n"
"n"
"n"
)
(command "-style" "mota" "txt.shx" st1 "1" "0" "n" "n" "n")
(command "-layer" "s" "sothutu" "")
(command "text" td "" thunhat)
; (command "-style" "mota" "txt.shx" st1 "1" "0" "n" "n" "n")
; (command "-layer" "s" "caodo" "")
; (command "text" "tl" td "" (rtos tdz 2 1))
)
------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
CHUONG TRINH CON:
---------------------------------------------------------------------------------------
(defun c:thuhoi (/ tenfile tenfile1 timfile dodaichuoi)
(setq dodaichuoi (strlen (getvar "dwgname")))
(setq tenfile1 (strcat (substr (getvar "dwgname") 1 (- dodaichuoi 3)) "xls"))
(setq tenfile (strcat (getvar "dwgprefix") (getvar "dwgname")))
(setq timfile (findfile (strcat (getvar "dwgprefix") tenfile1)))
(if (/= timfile nil)
(vl-file-delete timfile)
)
;(command "-eattext" "" "n" "n" "C:\\Program Files\\thuhoi.blk" "X" tenfile);Ghi file nhung bo bot vai cot
(command "-eattext" "" "n" "n" "" "X" tenfile);Ghi file nhung khong bo bot cot
)
(defun laytdgoc (tentrammay / len i sosanh)
(setq len (length tam))
(setq i 0)
(setq j 0)
(while (< i len)
(progn
(setq sosanh (car (nth i tam)))
(if (= tentrammay sosanh)
(progn
(setq j (+ j 1))
(setq xtram (cadr (nth i tam)))
(setq ytram (caddr (nth i tam)))
(if (/= (cadddr (nth i tam)) nil)
(setq htram (cadddr (nth i tam)))
(setq htram 0.0)
)
)
(progn
(if (= j 0)
(progn
(setq xtram 0)
(setq ytram 0)
(setq htram 0)
)
)
)
)
(setq i (+ i 1))
)
)
)
(defun ConvtoStr (Sym)
(setq ftemp "temp.tmp")
(setq ftmp (open ftemp "w"))
(princ Sym ftmp)
(close ftmp)
(setq ftmp (open ftemp "r"))
(setq sym (read-line ftmp))
(close ftmp)
(princ sym)
)
(defun *error* (msg)
(princ "\nerror:")
(princ msg)
(command "osmode" h "")
(command "_.undo" "end")
(command "clayer" clay)
(command "u" "")
(alert " - - - - ha ha ha- - - -"
)
(setq *error* olderr)
(princ)
)
(defun bdau ()
;(setq FNr "c:\\program files\\sr.txt")
;(setq FNr (open FNr "r"))
;(setq PRr (read-line FNr))
;(if (/= PRr "0909.446.887")
;(alert "VAY LA OK!" )
<img src='https://www.cadviet.com/forum/public/style_emoticons/<#EMO_DIR#>/wink.png' class='bbc_emoticon' alt=';)' />
;(close FNr)
(command "_.undo" "begin")
(setq cmd (getvar "cmdecho"))
(setq plwid (getvar "plinewid"))
(setq elev (getvar "elevation"))
(setq thick (getvar "thickness"))
(setq hh (getvar "osmode"))
(setq clay (getvar "clayer"))
)
(defun kthuc ()
(command "plinewid" plwid)
(command "elevation" elev)
(command "thickness" thick)
(command "osmode" hh)
(command "_.undo" "end")
(command "clayer" clay)
(command "cmdecho" cmd)
)
(defun dpgtod (nhap / do phut giay)
(setq do (fix nhap))
(setq phut (fix (* (- nhap do) 100)))
(setq giay (* (- (* (- nhap do) 100) phut) 100))
(setq xuat (+ do (/ (* phut 1.0) 60) (/ giay 3600)))
)
(defun dtodpg (nhap / do phut giay)
(setq do (fix nhap))
(setq phut (fix (* (- nhap do) 60)))
(setq giay (* (- (* (- nhap do) 60) phut) 60))
(setq xuat (strcat (rtos do 2 0) "." (rtos phut 2 0) (rtos giay 2 0)))
)
(defun dd (nhap)
(setq len (strlen nhap))
(cond ((= len 1) (setq xuat (strcat nhap " ")))
((= len 2) (setq xuat (strcat nhap " ")))
((= len 3) (setq xuat (strcat nhap " ")))
((= len 4) (setq xuat (strcat nhap " ")))
((= len 5) (setq xuat (strcat nhap " ")))
((= len 6) (setq xuat (strcat nhap " ")))
((= len 7) (setq xuat (strcat nhap " ")))
((= len 8) (setq xuat (strcat nhap " ")))
((= len 9) (setq xuat (strcat nhap " ")))
((= len 10) (setq xuat (strcat nhap " ")))
((= len 11) (setq xuat (strcat nhap "")))
; ((= len 12) (setq xuat (strcat nhap " ")))
; ((= len 13) (setq xuat (strcat nhap " ")))
; ((= len 14) (setq xuat (strcat nhap " ")))
; ((= len 15) (setq xuat (strcat nhap " ")))
; ((= len 16) (setq xuat (strcat nhap " ")))
; ((= len 17) (setq xuat (strcat nhap " ")))
; ((= len 18) (setq xuat (strcat nhap " ")))
; ((= len 19) (setq xuat (strcat nhap " ")))
; ((= len 20) (setq xuat (strcat nhap " ")))
; ((= len 21) (setq xuat (strcat nhap "")))
)
)
(defun dd1 (nhap)
(setq len (strlen nhap))
(cond ((= len 1) (setq xuat (strcat nhap " ")))
((= len 2) (setq xuat (strcat nhap " ")))
((= len 3) (setq xuat (strcat nhap " ")))
((= len 4) (setq xuat (strcat nhap " ")))
((= len 5) (setq xuat (strcat nhap " ")))
((= len 6) (setq xuat (strcat nhap " ")))
((= len 7) (setq xuat (strcat nhap " ")))
((= len 8) (setq xuat (strcat nhap " ")))
((= len 9) (setq xuat (strcat nhap " ")))
((= len 10) (setq xuat (strcat nhap " ")))
((= len 11) (setq xuat (strcat nhap " ")))
((= len 12) (setq xuat (strcat nhap " ")))
((= len 13) (setq xuat (strcat nhap " ")))
((= len 14) (setq xuat (strcat nhap " ")))
((= len 15) (setq xuat (strcat nhap " ")))
((= len 16) (setq xuat (strcat nhap " ")))
((= len 17) (setq xuat (strcat nhap " ")))
((= len 18) (setq xuat (strcat nhap " ")))
((= len 19) (setq xuat (strcat nhap " ")))
((= len 20) (setq xuat (strcat nhap " ")))
((= len 21) (setq xuat (strcat nhap "")))
)
)
file solieu và kết quả cần ra bản vẽ sau khi thực hiện xong
Tệp .lsp gốc không còn trên máy chủ. Hãy chép mã nguồn bên dưới (lấy từ bài viết gốc) vào một tệp văn bản, lưu với đuôi .lsp.
Cách dùng
- Chép mã nguồn, lưu thành tệp 250428_pdm_thuhoi.lsp.
- Trong AutoCAD gõ lệnh APPLOAD, chọn tệp vừa tải rồi bấm Load. Cũng có thể kéo thả tệp .lsp vào cửa sổ bản vẽ.
- Gõ lệnh PDM THUHOI để chạy lisp.
Mã nguồn 250428_pdm_thuhoi.lsp (trích từ bài viết gốc)
------------------------------------------------------------------------------------------------------------------------------------------------------------------
;******chuong trinh phun diem mia cho file duoc che bien tu may TOPCON 223**********
; DUNG CHO BAN DO DIA CHINH *
;* TR DCII-04 1014424.593 516275.846 *
;* TR DCII-07 1014339.861 516213.914 *
;* TR DCII-03 1014491.054 516180.297 *
;* TR DCII-06 1014670.141 516433.592 *
;* TR DCTI-04 *
;* DH DCII-03 *
;* 1 355.1447 66.896 *
;* 2 355.1519 47.576 *
;* 3 1.4545 48.375 *
;************************************************************************
(defun c:pdm (/ tam ms PR FN thunhat
tentram caodotram xtram ytram htram
tentrammay tendh
)
(bdau)
(setq tam ())
(setq ms (getreal "Nhap vao mau so ty le : "))
(setq
FN (getfiled "NhËp file nguån : "
""
""
4
)
)
(progn
(command "-osnap" "")
(setvar "cmdecho" 0)
(setvar "luprec" 8)
(setvar "pdmode" 0)
(command "-layer" "m" "diem" "c" "red" "" "")
; (command "-layer" "m" "caodo" "c" "cyan" "" "")
(command "-layer" "m" "sothutu" "c" "magenta" "" "")
(command "-layer" "m" "khongche" "c" "red" "" "")
(setq st (/ ms 1000))
(setq st1 st)
(command "-style" "mota" "txt.shx" st1 "1" "0" "n" "n" "n")
(setq FN (open FN "r"))
(while (and (setq PR (read-line FN)) (/= PR ""))
(progn
(setq PR (strcat "(" PR ")"))
(setq PR (read PR))
(setq thunhat (nth 0 PR))
(if
(numberp thunhat)
(gapsoA)
(gaptramA)
)
) ;end progn
) ;end while
) ;end progn
;;;;ket thuc viet lenh
(close FN)
(command "zoom" "e")
(kthuc)
(princ "\nVAY LA XONG!)*****")
(princ)
)
(defun gaptramA (/ x y)
(setq thunhat (convtostr thunhat))
(if (= thunhat "TR")
(progn
(setq ktra (nth 3 PR))
(if (/= ktra nil) ;GAP TRAM CHUA TOA DO GOC
(progn
(setq tentram (convtostr (nth 1 PR)))
(setq Y (nth 2 PR))
(setq X ktra)
; (setq h (nth 4 PR))
(setq tam (append tam (list (list tentram x y ))))
) ;GAP TRAM DO THUC TE
(progn
(setq tentrammay (convtostr (nth 1 PR)))
; (if (/= (nth 2 PR) nil)
; (setq caodotram (nth 2 PR))
; (setq caodotram 0)
; )
(laytdgoc tentrammay)
(setq tdtram1 (list (+ xtram (* 2 st)) ytram ))
(setq xxtram xtram)
(setq yytram ytram)
(setq tdtram (list xtram ytram))
(command "-layer" "s" "khongche" "")
;(command "point" tdtram)
(command "insert" "cdkc" tdtram st st "")
(setq sss (strlen tentrammay))
(setq tdtram2 (list (+ xtram (* 2 st) );(* (/ sss 2) st))
(- ytram (* 0.65 st))
)
)
; (command "insert"
; "l"
; tdtram1
; (* st sss)
; (* st sss)
; ""
; )
(command "-style"
"mota"
"txt.shx"
st
"1"
"0"
"n"
"n"
"n"
)
(command "text" "j" "bl" tdtram1 "" tentrammay)
(command "-style" "mota" "txt.shx" st1 "1" "0" "n" "n" "n")
; (command "-layer" "s" "khongche" "")
; (command "text" "j" "tl" tdtram2 "" (rtos htram 2 2))
)
)
) ;end progn
(if (= thunhat "DH") ;else
(progn
(setq tendh (convtostr (nth 1 PR)))
(laytdgoc tendh)
(setq tddh (list xtram ytram ))
(setq tddh1 (list (+ xtram (* 2 st)) ytram ))
(command "-layer" "s" "khongche" "")
(command "insert" "cdkc" tddh st st "")
;(command "point" tddh)
(setq sss (strlen tendh))
(setq tddh2 (list (+ xtram (* 2 st)); (* (/ sss 2) st))
(- ytram (* 0.65 st))
)
)
;(command "insert"
; "l"
; tddh1
; (* st sss)
; (* st sss)
; ""
<img src='https://www.cadviet.com/forum/public/style_emoticons/<#EMO_DIR#>/wink.png' class='bbc_emoticon' alt=';)' />
(command "-style"
"mota"
"txt.shx"
st
"1"
"0"
"n"
"n"
"n"
)
(command "text" "j" "bl" tddh1 "" tendh)
(command "-style" "mota" "txt.shx" st1 "1" "0" "n" "n" "n")
; (command "-layer" "s" "khongche" "")
; (command "text" "j" "tl" tddh2 "" (rtos htram 2 1))
)
)
)
)
(defun gapsoA (/ gocbang kc goctd tdx tdy tdz td dentah)
(setq gocbang (nth 1 PR))
(setq kc (nth 2 PR))
; (setq dentah (nth 3 PR))
(setq gocbang (dpgtod gocbang))
(setq gocbang (- 360 gocbang))
(setq gocbang (+ (/ (* gocbang pi) 180) (angle tdtram tddh)))
(setq tdX (+ xxtram (* kc (cos gocbang))))
(setq tdY (+ yytram (* kc (sin gocbang))))
; (if (/= dentah nil)
; (setq tdz (+ caodotram (nth 2 tdtram) dentah))
; (setq tdz 0)
; )
(setq td (list tdx tdy))
(setq td1 (list (+ tdx (* 0.5 st)) (+ tdy (* 0.3 st)) ))
(setq td2 (list (+ tdx (* 0.5 st)) (- tdy (* 0.3 st)) ))
(command "-layer" "s" "diem" "")
;(command "insert" "cdc" td st st "")
(command "point" td)
(command "-style"
"mota"
"txt.shx"
(* st 2)
"1"
"0"
"n"
"n"
"n"
)
(command "-style" "mota" "txt.shx" st1 "1" "0" "n" "n" "n")
(command "-layer" "s" "sothutu" "")
(command "text" td "" thunhat)
; (command "-style" "mota" "txt.shx" st1 "1" "0" "n" "n" "n")
; (command "-layer" "s" "caodo" "")
; (command "text" "tl" td "" (rtos tdz 2 1))
)
------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
CHUONG TRINH CON:
---------------------------------------------------------------------------------------
(defun c:thuhoi (/ tenfile tenfile1 timfile dodaichuoi)
(setq dodaichuoi (strlen (getvar "dwgname")))
(setq tenfile1 (strcat (substr (getvar "dwgname") 1 (- dodaichuoi 3)) "xls"))
(setq tenfile (strcat (getvar "dwgprefix") (getvar "dwgname")))
(setq timfile (findfile (strcat (getvar "dwgprefix") tenfile1)))
(if (/= timfile nil)
(vl-file-delete timfile)
)
;(command "-eattext" "" "n" "n" "C:\\Program Files\\thuhoi.blk" "X" tenfile);Ghi file nhung bo bot vai cot
(command "-eattext" "" "n" "n" "" "X" tenfile);Ghi file nhung khong bo bot cot
)
(defun laytdgoc (tentrammay / len i sosanh)
(setq len (length tam))
(setq i 0)
(setq j 0)
(while (< i len)
(progn
(setq sosanh (car (nth i tam)))
(if (= tentrammay sosanh)
(progn
(setq j (+ j 1))
(setq xtram (cadr (nth i tam)))
(setq ytram (caddr (nth i tam)))
(if (/= (cadddr (nth i tam)) nil)
(setq htram (cadddr (nth i tam)))
(setq htram 0.0)
)
)
(progn
(if (= j 0)
(progn
(setq xtram 0)
(setq ytram 0)
(setq htram 0)
)
)
)
)
(setq i (+ i 1))
)
)
)
(defun ConvtoStr (Sym)
(setq ftemp "temp.tmp")
(setq ftmp (open ftemp "w"))
(princ Sym ftmp)
(close ftmp)
(setq ftmp (open ftemp "r"))
(setq sym (read-line ftmp))
(close ftmp)
(princ sym)
)
(defun *error* (msg)
(princ "\nerror:")
(princ msg)
(command "osmode" h "")
(command "_.undo" "end")
(command "clayer" clay)
(command "u" "")
(alert " - - - - ha ha ha- - - -"
)
(setq *error* olderr)
(princ)
)
(defun bdau ()
;(setq FNr "c:\\program files\\sr.txt")
;(setq FNr (open FNr "r"))
;(setq PRr (read-line FNr))
;(if (/= PRr "0909.446.887")
;(alert "VAY LA OK!" )
<img src='https://www.cadviet.com/forum/public/style_emoticons/<#EMO_DIR#>/wink.png' class='bbc_emoticon' alt=';)' />
;(close FNr)
(command "_.undo" "begin")
(setq cmd (getvar "cmdecho"))
(setq plwid (getvar "plinewid"))
(setq elev (getvar "elevation"))
(setq thick (getvar "thickness"))
(setq hh (getvar "osmode"))
(setq clay (getvar "clayer"))
)
(defun kthuc ()
(command "plinewid" plwid)
(command "elevation" elev)
(command "thickness" thick)
(command "osmode" hh)
(command "_.undo" "end")
(command "clayer" clay)
(command "cmdecho" cmd)
)
(defun dpgtod (nhap / do phut giay)
(setq do (fix nhap))
(setq phut (fix (* (- nhap do) 100)))
(setq giay (* (- (* (- nhap do) 100) phut) 100))
(setq xuat (+ do (/ (* phut 1.0) 60) (/ giay 3600)))
)
(defun dtodpg (nhap / do phut giay)
(setq do (fix nhap))
(setq phut (fix (* (- nhap do) 60)))
(setq giay (* (- (* (- nhap do) 60) phut) 60))
(setq xuat (strcat (rtos do 2 0) "." (rtos phut 2 0) (rtos giay 2 0)))
)
(defun dd (nhap)
(setq len (strlen nhap))
(cond ((= len 1) (setq xuat (strcat nhap " ")))
((= len 2) (setq xuat (strcat nhap " ")))
((= len 3) (setq xuat (strcat nhap " ")))
((= len 4) (setq xuat (strcat nhap " ")))
((= len 5) (setq xuat (strcat nhap " ")))
((= len 6) (setq xuat (strcat nhap " ")))
((= len 7) (setq xuat (strcat nhap " ")))
((= len 8) (setq xuat (strcat nhap " ")))
((= len 9) (setq xuat (strcat nhap " ")))
((= len 10) (setq xuat (strcat nhap " ")))
((= len 11) (setq xuat (strcat nhap "")))
; ((= len 12) (setq xuat (strcat nhap " ")))
; ((= len 13) (setq xuat (strcat nhap " ")))
; ((= len 14) (setq xuat (strcat nhap " ")))
; ((= len 15) (setq xuat (strcat nhap " ")))
; ((= len 16) (setq xuat (strcat nhap " ")))
; ((= len 17) (setq xuat (strcat nhap " ")))
; ((= len 18) (setq xuat (strcat nhap " ")))
; ((= len 19) (setq xuat (strcat nhap " ")))
; ((= len 20) (setq xuat (strcat nhap " ")))
; ((= len 21) (setq xuat (strcat nhap "")))
)
)
(defun dd1 (nhap)
(setq len (strlen nhap))
(cond ((= len 1) (setq xuat (strcat nhap " ")))
((= len 2) (setq xuat (strcat nhap " ")))
((= len 3) (setq xuat (strcat nhap " ")))
((= len 4) (setq xuat (strcat nhap " ")))
((= len 5) (setq xuat (strcat nhap " ")))
((= len 6) (setq xuat (strcat nhap " ")))
((= len 7) (setq xuat (strcat nhap " ")))
((= len 8) (setq xuat (strcat nhap " ")))
((= len 9) (setq xuat (strcat nhap " ")))
((= len 10) (setq xuat (strcat nhap " ")))
((= len 11) (setq xuat (strcat nhap " ")))
((= len 12) (setq xuat (strcat nhap " ")))
((= len 13) (setq xuat (strcat nhap " ")))
((= len 14) (setq xuat (strcat nhap " ")))
((= len 15) (setq xuat (strcat nhap " ")))
((= len 16) (setq xuat (strcat nhap " ")))
((= len 17) (setq xuat (strcat nhap " ")))
((= len 18) (setq xuat (strcat nhap " ")))
((= len 19) (setq xuat (strcat nhap " ")))
((= len 20) (setq xuat (strcat nhap " ")))
((= len 21) (setq xuat (strcat nhap "")))
)
)Thảo luận gốc
Lisp được chia sẻ trong chủ đề [Nhờ chỉnh sửa] Nhờ hoàn thiện lisp phun điểm mia địa chính ra Autocad. Xem đúng bài viết #250428 để đọc hướng dẫn và trao đổi thêm.