Đến nội dung


Hình ảnh
- - - - -

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


  • Please log in to reply
6 replies to this topic

#1 hieupep1987

hieupep1987

    biết pan

  • Members
  • Pip
  • 5 Bài viết
Điểm đánh giá: -2 (bình thường)

Đã gửi 17 February 2016 - 10:29 AM

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)
)

Bài viết đã được chỉnh sửa nội dung bởi hieupep1987: 18 February 2016 - 10:21 AM

  • -1

#2 ketxu

ketxu

    Copier - Paster - Editor

  • Moderator
  • PipPipPipPipPipPipPip
  • 5678 Bài viết
Điểm đánh giá: 2605 (tuyệt vời)

Đã gửi 18 February 2016 - 09:47 AM

Nó đâu bạn ??


  • 0

Thành viên nhóm CadMagic.
Mời bạn ghé thăm facebook nhóm - Page viết lisp theo yêu cầu  :
CAD MAGIC


#3 hieupep1987

hieupep1987

    biết pan

  • Members
  • Pip
  • 5 Bài viết
Điểm đánh giá: -2 (bình thường)

Đã gửi 18 February 2016 - 10:23 AM

 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)
)

  • 0

#4 hieupep1987

hieupep1987

    biết pan

  • Members
  • Pip
  • 5 Bài viết
Điểm đánh giá: -2 (bình thường)

Đã gửi 18 February 2016 - 10:27 AM

http://www.cadviet.c...803_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)
)

  • 0

#5 phamthanhbinh

phamthanhbinh

    biết lệnh adcenter

  • Moderator
  • PipPipPipPipPipPipPip
  • 6007 Bài viết
Điểm đánh giá: 3113 (tuyệt vời)

Đã gửi 18 February 2016 - 10:45 AM

 

http://www.cadviet.c...803_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é.


  • 0
Chúc các quý Anh trên diễn đàn luôn khỏe, đẻ thêm được nhiều thứ để mót.

#6 hieupep1987

hieupep1987

    biết pan

  • Members
  • Pip
  • 5 Bài viết
Điểm đánh giá: -2 (bình thường)

Đã gửi 18 February 2016 - 12:29 PM

Thử rồi mà k được.:(


  • -1

#7 hieupep1987

hieupep1987

    biết pan

  • Members
  • Pip
  • 5 Bài viết
Điểm đánh giá: -2 (bình thường)

Đã gửi 18 February 2016 - 01:03 PM

Làm theo như bác hướng dẫn được rồi Phamthanhbinh. Lúc trước thử không được. Thank bác nhiều nha!:)


  • 0