Chuyển đến nội dung
Diễn đàn CADViet
  • Thông báo

    • Nguyen Hoanh

      CADViet đã hoàn tất nâng cấp   14/09/2017

      Chào các bạn, CADViet đã hoàn tất việc nâng cấp lên phiên bản mới. Tất cả các chức năng đã hoạt động theo kỳ vọng của ban quản trị. Nếu có vấn đề gì cần phản hồi, các bản post ở đây nhé: Trân trọng, Nguyễn Hoành.
Đăng nhập để thực hiện theo  
hieupep1987

Sửa Autoaplist Về Cao Độ Và Khoảng Cách

Các bài được khuyến nghị

hieupep1987    2

E có cái aplist nhưng không biết sửa sao cho phần thập phân sau dấu phảy là 5 chữ số, nhờ ae chỉ bảo với. Cảm ơn các bác nhiều. :((

 

(defun C:gcl ()
(setq os (getvar "osmode"))
(setvar "osmode" 163)
(prompt"\nHay scale ban ve theo ti le 1:1;")
(prompt"\nChon diem co cao do tren ban ve:")
(setq d (getpoint))
(setq dy (cadr d))
(setq dx (car d))
(prompt"\nNhap cao do diem vua pick(m):")
(setq c (getreal))
(setq i 1)
(prompt"\nDien gia tri ben trai:")
(while (= i 1)
(setvar "osmode" 163)
(prompt"\nChon diem can ghi tren ban ve:")
(setq g (getpoint))
(if (= g nill) (setq i 0)
(progn
(setq gy (cadr g))
(setq gx (car g))
(setq cdo (+ c (- gy dy)))
(setq kc (abs (- gx dx)))
(setq gc (list (- gx 0.1) gy))
(setq gkc (list (+ gx 0.3) (+ gy 0.01)))
(command "layer" "N" "ghic" "C" "green" "ghic" "")
(command "style" "chu" "TXT.shx" "" "" "" "" "" "")
(setvar "osmode" 0)
(command "layer" "S" "ghic" "")
(command "style" "chu" "" "" "" "" "" "" "")
(setq cdo (rtos cdo 2 2))
(setq kc (rtos kc 2 2))
(command "text" "j" "br" gc "0.1" "0" cdo)
(command "text" "j" "bl" gkc "0.1" "0" kc)
)
)
)
(prompt"\nDien gia tri ben phai:")
(setq i 1)
(while (= i 1)
(setvar "osmode" 163)
(prompt"\nChon diem can ghi tren ban ve:")
(setq g (getpoint))
(if (= g nill) (setq i 0)
(progn
(setq gy (cadr g))
(setq gx (car g))
(setq cdo (+ c (- gy dy)))
(setq kc (abs (- gx dx)))
(setq gc (list (+ gx 0.1) gy))
(setq gkc (list (- gx 0.3) (+ gy 0.01)))
(command "layer" "N" "ghic" "C" "green" "ghic" "")
(command "style" "chu" "TXT.shx" "" "" "" "" "" "")
(setvar "osmode" 0)
(command "layer" "S" "ghic" "")
(command "style" "chu" "" "" "" "" "" "" "")
(setq cdo (rtos cdo 2 2))
(setq kc (rtos kc 2 2))
(command "text" "j" "bl" gc "0.1" "0" cdo)
(command "text" "j" "bl" gkc "0.1" "0" kc)
)
)
)
(prompt"\nDien gia tri cao do tai tim:")
(setq i 1)
(while (= i 1)
(setvar "osmode" 163)
(prompt"\nChon diem can ghi tren ban ve:")
(setq g (getpoint))
 
(if (= g nill) (setq i 0)
(progn
(setq gy (cadr g))
(setq gx (car g))
(setq cdo (+ c (- gy dy)))
(setq kc (abs (- gx dx)))
(setq gc (list (+ gx 0.07) gy))
(command "layer" "N" "ghic" "C" "green" "ghic" "")
(command "style" "chu" "TXT.shx" "" "" "" "" "" "")
(setvar "osmode" 0)
(command "layer" "S" "ghic" "")
(command "style" "chu" "" "" "" "" "" "" "")
(setq cdo (rtos cdo 2 2))
;(setq kc (rtos kc 2 2))
(command "text" "j" "bl" gc "0.1" "0" cdo)
;(command "text" "j" "bl" gkc "0.1" "0" kc)
)
)
)
(prompt"\nDien ten lop:")
(setq i 1)
(setq j (getint "Nhap lop so ???"))
(while (= i 1)
(setvar "osmode" 163)
(prompt"\nChon diem can ghi Ten lop:")
(setq g (getpoint))
(if (= g nill) (setq i 0)
(progn
(setq gy (cadr g))
(setq gx (car g))
;(setq cdo (+ c (- gy dy)))
;(setq kc (abs (- gx dx)))
(setq gc (list (+ gx 1) (+ gy 0.03)))
(setq gc1 (list (+ gx 1.05) (+ gy 0.03)))
(command "layer" "N" "ghic" "C" "green" "ghic" "")
(command "style" "chu" "TXT.shx" "" "" "" "" "" "")
(setvar "osmode" 0)
(command "layer" "S" "ghic" "")
(command "style" "chu" "" "" "" "" "" "" "")
;(setq cdo (rtos cdo 2 2))
;(setq kc (rtos kc 2 2))
 
(command "text" "j" "br" gc "0.1" "0" "L")
(command "text" "j" "bl" gc1 "0.1" "0" j)
(setq j (+ j 1))
)
)
)
(command "layer" "S" "0" "")
(setvar "osmode" os)
)
Chỉnh sửa theo hieupep1987
  • Vote giảm 1

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác
hieupep1987    2
 Bác không nhận được à? e gửi lại đây này. Bác xem thử và giúp e cái.:(

(defun C:gcl ()

(setq os (getvar "osmode"))

(setvar "osmode" 163)

(prompt"\nHay scale ban ve theo ti le 1:1;")

(prompt"\nChon diem co cao do tren ban ve:")

(setq d (getpoint))

(setq dy (cadr d))

(setq dx (car d))

(prompt"\nNhap cao do diem vua pick(m):")

(setq c (getreal))

(setq i 1)

(prompt"\nDien gia tri ben trai:")

(while (= i 1)

(setvar "osmode" 163)

(prompt"\nChon diem can ghi tren ban ve:")

(setq g (getpoint))

(if (= g nill) (setq i 0)

(progn

(setq gy (cadr g))

(setq gx (car g))

(setq cdo (+ c (- gy dy)))

(setq kc (abs (- gx dx)))

(setq gc (list (- gx 0.1) gy))

(setq gkc (list (+ gx 0.3) (+ gy 0.01)))

(command "layer" "N" "ghic" "C" "green" "ghic" "")

(command "style" "chu" "TXT.shx" "" "" "" "" "" "")

(setvar "osmode" 0)

(command "layer" "S" "ghic" "")

(command "style" "chu" "" "" "" "" "" "" "")

(setq cdo (rtos cdo 2 2))

(setq kc (rtos kc 2 2))

(command "text" "j" "br" gc "0.1" "0" cdo)

(command "text" "j" "bl" gkc "0.1" "0" kc)

)

)

)

(prompt"\nDien gia tri ben phai:")

(setq i 1)

(while (= i 1)

(setvar "osmode" 163)

(prompt"\nChon diem can ghi tren ban ve:")

(setq g (getpoint))

(if (= g nill) (setq i 0)

(progn

(setq gy (cadr g))

(setq gx (car g))

(setq cdo (+ c (- gy dy)))

(setq kc (abs (- gx dx)))

(setq gc (list (+ gx 0.1) gy))

(setq gkc (list (- gx 0.3) (+ gy 0.01)))

(command "layer" "N" "ghic" "C" "green" "ghic" "")

(command "style" "chu" "TXT.shx" "" "" "" "" "" "")

(setvar "osmode" 0)

(command "layer" "S" "ghic" "")

(command "style" "chu" "" "" "" "" "" "" "")

(setq cdo (rtos cdo 2 2))

(setq kc (rtos kc 2 2))

(command "text" "j" "bl" gc "0.1" "0" cdo)

(command "text" "j" "bl" gkc "0.1" "0" kc)

)

)

)

(prompt"\nDien gia tri cao do tai tim:")

(setq i 1)

(while (= i 1)

(setvar "osmode" 163)

(prompt"\nChon diem can ghi tren ban ve:")

(setq g (getpoint))

 

(if (= g nill) (setq i 0)

(progn

(setq gy (cadr g))

(setq gx (car g))

(setq cdo (+ c (- gy dy)))

(setq kc (abs (- gx dx)))

(setq gc (list (+ gx 0.07) gy))

(command "layer" "N" "ghic" "C" "green" "ghic" "")

(command "style" "chu" "TXT.shx" "" "" "" "" "" "")

(setvar "osmode" 0)

(command "layer" "S" "ghic" "")

(command "style" "chu" "" "" "" "" "" "" "")

(setq cdo (rtos cdo 2 2))

;(setq kc (rtos kc 2 2))

(command "text" "j" "bl" gc "0.1" "0" cdo)

;(command "text" "j" "bl" gkc "0.1" "0" kc)

)

)

)

(prompt"\nDien ten lop:")

(setq i 1)

(setq j (getint "Nhap lop so ???"))

(while (= i 1)

(setvar "osmode" 163)

(prompt"\nChon diem can ghi Ten lop:")

(setq g (getpoint))

(if (= g nill) (setq i 0)

(progn

(setq gy (cadr g))

(setq gx (car g))

;(setq cdo (+ c (- gy dy)))

;(setq kc (abs (- gx dx)))

(setq gc (list (+ gx 1) (+ gy 0.03)))

(setq gc1 (list (+ gx 1.05) (+ gy 0.03)))

(command "layer" "N" "ghic" "C" "green" "ghic" "")

(command "style" "chu" "TXT.shx" "" "" "" "" "" "")

(setvar "osmode" 0)

(command "layer" "S" "ghic" "")

(command "style" "chu" "" "" "" "" "" "" "")

;(setq cdo (rtos cdo 2 2))

;(setq kc (rtos kc 2 2))

 

(command "text" "j" "br" gc "0.1" "0" "L")

(command "text" "j" "bl" gc1 "0.1" "0" j)

(setq j (+ j 1))

)

)

)

(command "layer" "S" "0" "")

(setvar "osmode" os)

)

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác
hieupep1987    2

http://www.cadviet.com/upfiles/5/149803_ghicdkc.lsp

 

Nó đâu bạn ??

Đây. bác giúp e với!

(defun C:gcl ()
(setq os (getvar "osmode"))
(setvar "osmode" 163)
(prompt"\nHay scale ban ve theo ti le 1:1;")
(prompt"\nChon diem co cao do tren ban ve:")
(setq d (getpoint))
(setq dy (cadr d))
(setq dx (car d))
(prompt"\nNhap cao do diem vua pick(m):")
(setq c (getreal))
(setq i 1)
(prompt"\nDien gia tri ben trai:")
(while (= i 1)
(setvar "osmode" 163)
(prompt"\nChon diem can ghi tren ban ve:")
(setq g (getpoint))
(if (= g nill) (setq i 0)
(progn
(setq gy (cadr g))
(setq gx (car g))
(setq cdo (+ c (- gy dy)))
(setq kc (abs (- gx dx)))
(setq gc (list (- gx 0.1) gy))
(setq gkc (list (+ gx 0.3) (+ gy 0.01)))
(command "layer" "N" "ghic" "C" "green" "ghic" "")
(command "style" "chu" "TXT.shx" "" "" "" "" "" "")
(setvar "osmode" 0)
(command "layer" "S" "ghic" "")
(command "style" "chu" "" "" "" "" "" "" "")
(setq cdo (rtos cdo 2 2))
(setq kc (rtos kc 2 2))
(command "text" "j" "br" gc "0.1" "0" cdo)
(command "text" "j" "bl" gkc "0.1" "0" kc)
)
)
)
(prompt"\nDien gia tri ben phai:")
(setq i 1)
(while (= i 1)
(setvar "osmode" 163)
(prompt"\nChon diem can ghi tren ban ve:")
(setq g (getpoint))
(if (= g nill) (setq i 0)
(progn
(setq gy (cadr g))
(setq gx (car g))
(setq cdo (+ c (- gy dy)))
(setq kc (abs (- gx dx)))
(setq gc (list (+ gx 0.1) gy))
(setq gkc (list (- gx 0.3) (+ gy 0.01)))
(command "layer" "N" "ghic" "C" "green" "ghic" "")
(command "style" "chu" "TXT.shx" "" "" "" "" "" "")
(setvar "osmode" 0)
(command "layer" "S" "ghic" "")
(command "style" "chu" "" "" "" "" "" "" "")
(setq cdo (rtos cdo 2 2))
(setq kc (rtos kc 2 2))
(command "text" "j" "bl" gc "0.1" "0" cdo)
(command "text" "j" "bl" gkc "0.1" "0" kc)
)
)
)
(prompt"\nDien gia tri cao do tai tim:")
(setq i 1)
(while (= i 1)
(setvar "osmode" 163)
(prompt"\nChon diem can ghi tren ban ve:")
(setq g (getpoint))
 
(if (= g nill) (setq i 0)
(progn
(setq gy (cadr g))
(setq gx (car g))
(setq cdo (+ c (- gy dy)))
(setq kc (abs (- gx dx)))
(setq gc (list (+ gx 0.07) gy))
(command "layer" "N" "ghic" "C" "green" "ghic" "")
(command "style" "chu" "TXT.shx" "" "" "" "" "" "")
(setvar "osmode" 0)
(command "layer" "S" "ghic" "")
(command "style" "chu" "" "" "" "" "" "" "")
(setq cdo (rtos cdo 2 2))
;(setq kc (rtos kc 2 2))
(command "text" "j" "bl" gc "0.1" "0" cdo)
;(command "text" "j" "bl" gkc "0.1" "0" kc)
)
)
)
(prompt"\nDien ten lop:")
(setq i 1)
(setq j (getint "Nhap lop so ???"))
(while (= i 1)
(setvar "osmode" 163)
(prompt"\nChon diem can ghi Ten lop:")
(setq g (getpoint))
(if (= g nill) (setq i 0)
(progn
(setq gy (cadr g))
(setq gx (car g))
;(setq cdo (+ c (- gy dy)))
;(setq kc (abs (- gx dx)))
(setq gc (list (+ gx 1) (+ gy 0.03)))
(setq gc1 (list (+ gx 1.05) (+ gy 0.03)))
(command "layer" "N" "ghic" "C" "green" "ghic" "")
(command "style" "chu" "TXT.shx" "" "" "" "" "" "")
(setvar "osmode" 0)
(command "layer" "S" "ghic" "")
(command "style" "chu" "" "" "" "" "" "" "")
;(setq cdo (rtos cdo 2 2))
;(setq kc (rtos kc 2 2))
 
(command "text" "j" "br" gc "0.1" "0" "L")
(command "text" "j" "bl" gc1 "0.1" "0" j)
(setq j (+ j 1))
)
)
)
(command "layer" "S" "0" "")
(setvar "osmode" os)
)

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác
phamthanhbinh    3.123

 

http://www.cadviet.com/upfiles/5/149803_ghicdkc.lsp

 

Đây. bác giúp e với!

(defun C:gcl ()
(setq os (getvar "osmode"))
(setvar "osmode" 163)
(prompt"\nHay scale ban ve theo ti le 1:1;")
(prompt"\nChon diem co cao do tren ban ve:")
(setq d (getpoint))
(setq dy (cadr d))
(setq dx (car d))
(prompt"\nNhap cao do diem vua pick(m):")
(setq c (getreal))
(setq i 1)
(prompt"\nDien gia tri ben trai:")
(while (= i 1)
(setvar "osmode" 163)
(prompt"\nChon diem can ghi tren ban ve:")
(setq g (getpoint))
(if (= g nill) (setq i 0)
(progn
(setq gy (cadr g))
(setq gx (car g))
(setq cdo (+ c (- gy dy)))
(setq kc (abs (- gx dx)))
(setq gc (list (- gx 0.1) gy))
(setq gkc (list (+ gx 0.3) (+ gy 0.01)))
(command "layer" "N" "ghic" "C" "green" "ghic" "")
(command "style" "chu" "TXT.shx" "" "" "" "" "" "")
(setvar "osmode" 0)
(command "layer" "S" "ghic" "")
(command "style" "chu" "" "" "" "" "" "" "")
(setq cdo (rtos cdo 2 2))
(setq kc (rtos kc 2 2))
(command "text" "j" "br" gc "0.1" "0" cdo)
(command "text" "j" "bl" gkc "0.1" "0" kc)
)
)
)
(prompt"\nDien gia tri ben phai:")
(setq i 1)
(while (= i 1)
(setvar "osmode" 163)
(prompt"\nChon diem can ghi tren ban ve:")
(setq g (getpoint))
(if (= g nill) (setq i 0)
(progn
(setq gy (cadr g))
(setq gx (car g))
(setq cdo (+ c (- gy dy)))
(setq kc (abs (- gx dx)))
(setq gc (list (+ gx 0.1) gy))
(setq gkc (list (- gx 0.3) (+ gy 0.01)))
(command "layer" "N" "ghic" "C" "green" "ghic" "")
(command "style" "chu" "TXT.shx" "" "" "" "" "" "")
(setvar "osmode" 0)
(command "layer" "S" "ghic" "")
(command "style" "chu" "" "" "" "" "" "" "")
(setq cdo (rtos cdo 2 2))
(setq kc (rtos kc 2 2))
(command "text" "j" "bl" gc "0.1" "0" cdo)
(command "text" "j" "bl" gkc "0.1" "0" kc)
)
)
)
(prompt"\nDien gia tri cao do tai tim:")
(setq i 1)
(while (= i 1)
(setvar "osmode" 163)
(prompt"\nChon diem can ghi tren ban ve:")
(setq g (getpoint))
 
(if (= g nill) (setq i 0)
(progn
(setq gy (cadr g))
(setq gx (car g))
(setq cdo (+ c (- gy dy)))
(setq kc (abs (- gx dx)))
(setq gc (list (+ gx 0.07) gy))
(command "layer" "N" "ghic" "C" "green" "ghic" "")
(command "style" "chu" "TXT.shx" "" "" "" "" "" "")
(setvar "osmode" 0)
(command "layer" "S" "ghic" "")
(command "style" "chu" "" "" "" "" "" "" "")
(setq cdo (rtos cdo 2 2))
;(setq kc (rtos kc 2 2))
(command "text" "j" "bl" gc "0.1" "0" cdo)
;(command "text" "j" "bl" gkc "0.1" "0" kc)
)
)
)
(prompt"\nDien ten lop:")
(setq i 1)
(setq j (getint "Nhap lop so ???"))
(while (= i 1)
(setvar "osmode" 163)
(prompt"\nChon diem can ghi Ten lop:")
(setq g (getpoint))
(if (= g nill) (setq i 0)
(progn
(setq gy (cadr g))
(setq gx (car g))
;(setq cdo (+ c (- gy dy)))
;(setq kc (abs (- gx dx)))
(setq gc (list (+ gx 1) (+ gy 0.03)))
(setq gc1 (list (+ gx 1.05) (+ gy 0.03)))
(command "layer" "N" "ghic" "C" "green" "ghic" "")
(command "style" "chu" "TXT.shx" "" "" "" "" "" "")
(setvar "osmode" 0)
(command "layer" "S" "ghic" "")
(command "style" "chu" "" "" "" "" "" "" "")
;(setq cdo (rtos cdo 2 2))
;(setq kc (rtos kc 2 2))
 
(command "text" "j" "br" gc "0.1" "0" "L")
(command "text" "j" "bl" gc1 "0.1" "0" j)
(setq j (+ j 1))
)
)
)
(command "layer" "S" "0" "")
(setvar "osmode" os)
)

 

Hề hề hề,

Hãy thử thay tất cả các hàm (rtos .... 2 2) thành (rtos .... 2 5) coi sao nhé.

Chia sẻ bài đăng này


Liên kết tới bài đăng
Chia sẻ trên các trang web khác

Tạo một tài khoản hoặc đăng nhập để nhận xét

Bạn cần phải là một thành viên để lại một bình luận

Tạo tài khoản

Đăng ký một tài khoản mới trong cộng đồng của chúng tôi. Điều đó dễ mà.

Đăng ký tài khoản mới

Đăng nhập

Bạn có sẵn sàng để tạo một tài khoản ? Đăng nhập tại đây.

Đăng nhập ngay

Đăng nhập để thực hiện theo  

×