Chuyển đến nội dung
Diễn đàn CADViet
Công ty CONSID tuyển dụng kiến trúc sư
Đăng nhập để thực hiện theo  
Tranquang259

Xin Giải Đáp Cách Dùng Lisp ( Chèn Cao Độ , Kích Thước Trắc Ngang Hoàn Công Đường)

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

(setvar "CMDECHO" 0)

 
(defun DXF (code elist)
   (cdr (assoc code elist))
)
(setq m (getreal "\n Nhap ty le ban ve : "))
 
(defun C:HH ()
  (setvar "textstyle" "standard" )
  (setq m 200.0)
  (setq sy (/ 1000.0 m))
  (command "layer" "s" 0 "")
  (SETQ LAST (GETVAR "OSMODE"))
  (command "osnap" "NONE")
  (print)
  (print)
  (print)
  (command "osnap" "NEAREST")
  (setq pt (osnap (getpoint "Diem goc toa do <nearest to> : ") "nearest"))
  (print)
  (setq yo (cadr pt))
  (setq pt (osnap (getpoint "Noi ghi cao do <nearest to>  : ") "nearest"))
  (print)
  (setq y2 (cadr pt))
  (setq y1 (- y2 5))
  (setq y3 (+ y2 11))
  (command "osnap" "")
  (command "osnap" "END")
  (setq pt (osnap (getpoint "Diem chuan < end of         : ") "end"))
  (print)
  (setq yc (cadr pt))
  (initget (+ 1 4))
  (setq en1 (car (entsel "Cao do : ")))
   (setq elst1 (entget en1))
    (setq chso1 (cdr (assoc 1 elst1)))
    (setq hc (atof (substr chso1 1)))
    (setq dy (- (* sy hc) yc))
    (command "osnap" "end")
    (setq pt  (getpoint " Diem < end of > : ") )
    (while (/=   pt  nil)
    (command "osnap" "")
    (setq x (car pt) y (cadr pt))
    (setq h (/ (+ y dy) sy))
    (setq x1 (+ x 1))
    (command "line" (list x y1) (list x y2) "")
    (command "layer" "s" 3 "")
    (command "line" (list x yo) (list x y) "")
    (command "layer" "s" 0 "")
    (command "text" "r" (list x1 y3) 1.8 90 (rtos h 2 2))
    (command "osnap" "end")
    (setq pt  (getpoint " Diem < end of > : ") )
  )
    (SETVAR "OSMODE" LAST)
)
(defun C:HL ()
  (setvar "textstyle" "standard" )
  (setq m 200.0)
  (setq sy (/ 1000.0 m))
  (command "layer" "s" 0 "")
  (SETQ LAST (GETVAR "OSMODE"))
  (command "osnap" "NONE")
  (print)
  (print)
  (print)
  (command "osnap" "NEAREST")
  (setq pt (osnap (getpoint "Diem goc toa do <nearest to> : ") "nearest"))
  (print)
  (setq yo (cadr pt))
  (setq pt (osnap (getpoint "Noi ghi cao do <nearest to>  : ") "nearest"))
  (print)
  (setq y2 (cadr pt))
  (setq y1 (- y2 5))
  (setq y3 (+ y2 1))
  (command "osnap" "")
  (command "osnap" "END")
  (setq pt (osnap (getpoint "Diem chuan < end of         : ") "end"))
  (print)
  (setq yc (cadr pt))
  (initget (+ 1 4))
  (setq en1 (car (entsel "Cao do : ")))
   (setq elst1 (entget en1))
    (setq chso1 (cdr (assoc 1 elst1)))
    (setq hc (atof (substr chso1 1)))
    (setq dy (- (* sy hc) yc))
    (command "osnap" "end")
    (setq pt  (getpoint " Diem < end of > : ") )
    (while (/=   pt  nil)
    (command "osnap" "")
    (setq x (car pt) y (cadr pt))
    (setq h (/ (+ y dy) sy))
    (setq x1 (+ x 1))
    (command "layer" "s" 3 "")
    (command "line" (list x yo) (list x y) "")
    (command "layer" "s" 0 "")
    (command "text" "ml" (list x1 y3) 1.8 90 (rtos h 2 2))
    (command "osnap" "end")
    (setq pt  (getpoint " Diem < end of > : ") )
  )
    (SETVAR "OSMODE" LAST)
)
(defun C:LL ( / sxt,sx,pt,dx,y1,y2,x1,x2,)
  (setq m 200.0)
  (setq sx (/ 1000.0 m))
  (command "layer" "s" 0 "")
  (Setq last (GETVAR "OSMODE"))
  (setq lastdz (getvar "dimzin"))
  (setvar "dimzin" 0)
  (command "osnap" "NONE")
  (command "osnap" "nearest")
  (setq pt (osnap (getpoint "Noi ghi cu ly <nearest to> : ") "nearest"))
  (command "osnap" "")
  (setq y1 (cadr pt))
  (setq y2 (+ y1 5.0))
  (setq yc (+ y1 2.5))
  (setq yc1 (+ y1 1.0))
  (setq yc2 (+ y1 4.0))
  (setq yc3 (+ y1 1.5))
  (command "osnap" "end")
  (setq pt (getpoint "Diem 1 < end of > : ")) 
  (setq x1 (car pt))
  (while (/= pt nil)
  (setq pt (getpoint "Diem 2 < end of > : "))
  (setq x2 (car pt))
      (command "osnap" "")
      (if (< x2 x1)
        (progn
          (setq xg x2)
          (setq x2 x1)
          (setq x1 xg)
        )
      )
      (setq dx (- x2 x1))
      (setq xt (/ dx sx))
      (setq sxt (rtos xt 2 2))
      (setq hst (DXF 40 (tblsearch "STYLE" (getvar "TEXTSTYLE"))))
      (setq xg (/ (+ x1 x2) 2.0))
      (setq xg1 (+ xg 1.0))
      (setq x1 (+ x1 0.5))
      (setq x2 (- x2 0.5))
      (princ xt)
      (if (> xt 1.0) 
               (if (/= 0 hst)
                  (command "text" "J" "m" (list xg yc) 0 sxt) 
                  (command "text" "J" "m" (list xg yc) 2 0 sxt) 
               )
       )         
       (if (and (<= xt 1.0) (> xt 0.8))
               (if (/= 0 hst)
                       (command "text" "j" "f" (list x1 yc3) (list x2 yc3)  sxt)
                       (command "text" "j" "f" (list x1 yc3) (list x2 yc3) 2 sxt)
               )
       )
       (if (<= xt 0.8) 
               (if (/= 0 hst)
                       (command "text" "j" "f" (list xg1 yc1) (list xg1 yc2)  sxt)
                       (command "text" "j" "f" (list xg1 yc1) (list xg1 yc2) 2 sxt)
               )
       )
       (command "osnap" "end")
       (setq pt (getpoint "Diem 1 < end of > : ")) 
       (setq x1 (car pt))      
)
    (SETVAR "OSMODE" LAST)
    (SETVAR "dimzin" lastdz)
)
 
  • Vote giảm 3

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
Công ty CONSID tuyển dụng kiến trúc sư

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  

×