자료실 Q&A
글 수 2,319
||||리습기능은요
1. 이 리습은 치수가 블럭화되어 있지않고 그냥 치수선과 치수문자가
분리되어 그려줍니다.
2. 단선치수,및 다중치수가 가능하고요
치수선끝에 버블및 주열번호까지 한번에 그릴수있습니다.
3. 수평칫수-DH명령 상하부에 그릴수있고요
수직치수-DV영령 좌우측에 그릴수있어요
R14에서는 사용가능 하고요
2000에서는 치수선만 그려지고 치수text가 안써지면서 이런 메세지가뜨네요
error: incorrect object to bind: T
참 좋은 리습인데 그냥 버리기가 넘아까워요
아무리봐도 이상해요
R11부터 R14까지 잘 쓰던것이 왜 안되는지.
파일을 올리려고 하는데 사용권한이 없데요?
파일 올리느데도 권한이 필요한가요??
하수연님, 추운겨울님 관심 가져주셔서 고맙습니다.
버블과도트(dwg)는 메일 보내수심 보내드릴께요
(dollpagu@yahoo.co.kr)
고수님들 부탁좀 드릴께요.
수평칫수-DH소스
(DEFUN LASET (Q:LA / Z)
(if (TBLSEARCH "LAYER" Q:LA)
(COMMAND "LAYER" "S" Q:LA "")
(COMMAND "LAYER" "M" Q:LA "")
)
)
; dimsion Text Conversion Sub-Program
(defun txtcon(txt / n no n1 n2 txts t tt)
(setq tt (rtos txt 2 0))
(setq n (strlen tt))
(if (> n 3)
(progn
(setq n1 (rem n 3))
(setq n2 (/ (- n n1) 3))
(setq no 1)
(setq txts "")
(repeat (1+ n2)
(if (< no (1+ n2))
(setq t (strcat "." (substr tt (- (1+ n) (* 3 no)) 3)))
(setq t (substr tt 1 n1))
)
(setq txts (strcat t txts))
(setq no (1+ no))
)
(setq txt txts)
)
(setq txt tt)
)
)
; Bubble Inserting Sub-Program
(defun bip(pt scf ang)
(LASET "dim")
(command "insert" "bubble" pt ds "" ang)
)
; Drawing Bubble-text Sub-program
(defun dbt(pt h ang txt)
(LASET "dim")
(command "text" "m" pt h ang txt)
)
; Downside dimsion Line DWG. Program
(defun dwgdimud(/ dbpt no dist x1 x2 y1 y2 l pt1 pt2 pt h ang)
(princ "\n ")
(setq dbpt (getpoint "\n>>> Location of Horizontal dimsion :"))
(setvar "blipmode" 0)
(setq dbpt (list (car bpt) (cadr dbpt)))
(setq ang1 (angle bpt dbpt))
(setq no 1)
(setq dist 0)
(setq l (append '(0.0) clist))
(setq x1 (car dbpt))
(if (= ang1 (dtr 270))
(setq y1 (- (cadr bpt) (* 3.0 ds)))
)
(if (= ang1 (dtr 90))
(setq y1 (+ (cadr bpt) (* 3.0 ds)))
)
(repeat (1+ cno)
(if (= ang1 (dtr 270))
(progn
(if (= sd "D")
(if (and (< 1 no) (< no (1+ cno)))
(setq y2 (+ (cadr dbpt) (* 6.0 ds)))
(setq y2 (- (cadr dbpt) (* 2.0 ds)))
)
)
(if (= sd "S")
(setq y2 (- (cadr dbpt) (* 2.0 ds)))
)
)
)
(if (= ang1 (dtr 90))
(progn
(if (= sd "D")
(if (and (< 1 no) (< no (1+ cno)))
(setq y2 (- (cadr dbpt) (* 6.0 ds)))
(setq y2 (+ (cadr dbpt) (* 2.0 ds)))
)
)
(if (= sd "S")
(setq y2 (+ (cadr dbpt) (* 2.0 ds)))
)
)
)
(setq dist (+ dist (nth (1- no) l)))
(setq x2 (+ x1 dist))
(setq pt1 (list x2 y1))
(setq pt2 (list x2 y2))
(LASET "dim")
(command "line" pt1 pt2 "")
(if (= ang1 (dtr 270))
(progn
(if (= sd "D")
(setq y2 (+ (cadr dbpt) (* 8.0 ds)))
)
(if (= sd "S")
(setq y2 (cadr dbpt))
)
)
)
(if (= ang1 (dtr 90))
(progn
(if (= sd "D")
(setq y2 (- (cadr dbpt) (* 8.0 ds)))
)
(if (= sd "S")
(setq y2 (cadr dbpt))
)
)
)
(setq pt (list x2 y2))
(command "insert" "dimdot" pt (* 1.5 ds) "" "")
(if (= sd "D")
(progn
(if (or (= 1 no) (= no (1+ cno)))
(progn
(if (= ang1 (dtr 270))
(progn
(setq pt (list 0.0 (* -8.0 ds)))
(command "copy" "last" "" "0,0" pt)
)
)
(if (= ang1 (dtr 90))
(progn
(setq pt (list 0.0 (* 8.0 ds)))
(command "copy" "last" "" "0,0" pt)
)
)
)
)
)
)
(setq no (1+ no))
)
(setq pt1 (list (- (car dbpt) (* 2.0 ds)) (cadr dbpt)))
(setq pt2 (list (+ (car dbpt) (apply '+ clist) (* 2.0 ds)) (cadr dbpt)))
(command "line" pt1 pt2 "")
(if (= sd "D")
(progn
(if (= ang1 (dtr 270))
(setq pt (list 0.0 (* 8.0 ds)))
)
(if (= ang1 (dtr 90))
(setq pt (list 0.0 (* -8.0 ds)))
)
(command "copy" "last" "" "0,0" pt)
)
)
; DWG dimsion-text
(LASET "dim")
(setq no 1)
(setq dist 0)
(setq l (append '(0.0) clist))
(if (= ang1 (dtr 270))
(if (= sd "S")
(setq x1 (car dbpt))
)
)
(if (= ang1 (dtr 90))
(setq x1 (car dbpt)
y1 (- (cadr dbpt) (* 7.0 ds))
)
)
(if (= sd "D")
(progn
(repeat (1+ cno)
(if (= no 1)
(progn
(setq y2 (+ (cadr dbpt) (* 1.0 ds)))
(setq x2 (+ (car dbpt) (/ (apply '+ clist) 2)))
(setq txt (apply '+ clist))
(setq txt (txtcon txt))
(setq pt (list x2 y2))
(setq h (* 3.0 ds))
(command "text" "c" pt h "0" txt)
)
(progn
(if (= ang1 (dtr 270))
(setq y2 (+ (cadr dbpt) (* 9.0 ds)))
)
(if (= ang1 (dtr 90))
(setq y2 (- (cadr dbpt) (* 7.0 ds)))
)
(setq txt (nth (1- no) l))
(if (= ang1 (dtr 270))
(setq x2 (+ (car dbpt) dist (/ txt 2)))
)
(if (= ang1 (dtr 90))
(setq x2 (+ x1 dist (/ txt 2)))
)
(setq dist (+ txt dist))
(setq txt (txtcon txt))
(setq pt (list x2 y2))
(setq h (* 3.0 ds))
(command "text" "c" pt h "0" txt)
)
)
(setq no (1+ no))
)
)
)
(if (= sd "S")
(progn
(repeat cno
(setq y2 (+ (cadr dbpt) (* 1.0 ds)))
(setq txt (nth no l))
(setq x2 (+ x1 dist (/ txt 2)))
(setq dist (+ txt dist))
(setq txt (txtcon txt))
(setq pt (list x2 y2))
(setq h (* 3.0 ds))
(command "text" "c" pt h "0" txt)
(setq no (1+ no))
)
)
)
; DWG Column-bubbles
(setq a (strcase (getstring "\n>>> Do you want to draw column-bubbles? <n> : ")))
(if (= a "Y")
(progn
(setq no 1)
(setq l (append '(0.0) clist))
(setq dist 0)
(setq x1 (car dbpt))
(if (= ang1 (dtr 270))
(setq y1 (- (cadr dbpt) (* 6.0 ds)))
)
(if (= ang1 (dtr 90))
(setq y1 (+ (cadr dbpt) (* 6.0 ds)))
)
(repeat (1+ cno)
(setq dist (+ dist (nth (1- no) l)))
(setq x2 (+ x1 dist))
(setq pt (list x2 y1))
(if (= ang1 (dtr 270))
(setq ang "180")
)
(if (= ang1 (dtr 90))
(setq ang "0")
)
(bip pt ds ang)
(setq a (strcase (getstring "\n>>> Here? <Column Number or No!> : ")))
(if (= a "N")
(command "erase" "last" "")
(progn
(if (= sd "D")
(progn
(if (= ang1 (dtr 270))
(setq pt (list x2 (- y2 (* 26.02 ds))))
)
(if (= ang1 (dtr 90))
(setq pt (list x2 (+ y2 (* 24.01 ds))))
)
)
)
(if (= sd "S")
(progn
(if (= ang1 (dtr 270))
(setq pt (list x2 (- y2 (* 18.02 ds))))
)
(if (= ang1 (dtr 90))
(setq pt (list x2 (+ y2 (* 16.01 ds))))
)
)
)
(setq txt a)
(setq h (* 4.0 ds))
(if (= ang1 (dtr 270))
(setq ang "0")
)
(dbt pt h ang txt)
)
)
(setq no (1+ no))
)
)
)
)
; Main Program
(defun C:DH(/ pt l no no1 no2 a dist os)
(princ ">>> [DH] Horizon dimsion+Line.....")
(setvar "cmdecho" 0)
(SETQ Q:LAINIT (GETVAR "CLAYER"))
(setvar "orthomode" 1)
(setq ds1 (getvar "dimscale"))
(if (<= ds1 600)
(setq ds (* 1.0 ds1))
)
(if (> ds1 600)
(setq ds (* 0.6666666 ds1))
)
(command "style" "romans" "" "0" "" "" "" "" "")
(initget 1 "S D ")
(if (= sd nil) (setq sd "S"))
(setq sd1 (getkword (strcat "\n>>> <S>ingle or <D>ouble [" sd "] :")))
(if (member sd1 '("S" "D")) (setq sd sd1))
(setvar "blipmode" 1)
(setvar "osmode" 1)
(initget 1)
(setq bpt (getpoint "\n>>> Pick Basepoint :"))
(setq clist '())
(setq cno 0)
(setq pt bpt)
(while pt
(setq no1 (itoa cno) no2 (itoa (1+ cno)))
(setq a (strcat no1 " and " no2 ": "))
(setvar "osmode" 128)
(princ "\n>>> Pick Next Point :")
(princ a)
(setq dist (getdist pt))
(if dist
(progn
(setq pt (polar pt 0.0 dist))
(setq dist (list dist))
(setq clist (append clist dist))
(setq cno (1+ cno))
)
(setq pt nil)
)
)
(setvar "osmode" 0)
(dwgdimud)
(LASET Q:LAINIT)
(command "style" "romans" "" "0" "" "" "" "" "")
(setvar "cmdecho" 1)
(setvar "blipmode" 1)
(prin1)
)
수직칫수-DV소스
(DEFUN LASET (Q:LA / Z)
(if (TBLSEARCH "LAYER" Q:LA)
(COMMAND "LAYER" "S" Q:LA "")
(COMMAND "LAYER" "M" Q:LA "")
)
)
; Downside dimsion Line DWG. Program
(defun dwgdimrl(/ dbpt no dist x1 x2 y1 y2 l pt1 pt2 pt h ang)
(princ "\n ")
(setq dbpt (getpoint "\n>>>Location of Vertical dimsion :"))
(setvar "blipmode" 0)
(setq dbpt (list (car dbpt) (cadr bpt)))
(setq ang1 (angle bpt dbpt))
(setq no 1)
(setq dist 0)
(setq l (append '(0.0) rlist))
(if (= ang1 (dtr 180))
(setq x1 (- (car bpt) (* 3.0 ds)))
)
(if (= ang1 0)
(setq x1 (+ (car bpt) (* 3.0 ds)))
)
(setq y1 (cadr dbpt))
(repeat (1+ rno)
(if (= ang1 (dtr 180))
(progn
(if (= sd "D")
(if (and (< 1 no) (< no (1+ rno)))
(setq x2 (+ (car dbpt) (* 6.0 ds)))
(setq x2 (- (car dbpt) (* 2.0 ds)))
)
)
(if (= sd "S")
(setq x2 (- (car dbpt) (* 2.0 ds)))
)
)
)
(if (= ang1 0)
(progn
(if (= sd "D")
(if (and (< 1 no) (< no (1+ rno)))
(setq x2 (- (car dbpt) (* 6.0 ds)))
(setq x2 (+ (car dbpt) (* 2.0 ds)))
)
)
(if (= sd "S")
(setq x2 (+ (car dbpt) (* 2.0 ds)))
)
)
)
(setq dist (+ dist (nth (1- no) l)))
(setq y2 (+ y1 dist))
(setq pt1 (list x1 y2))
(setq pt2 (list x2 y2))
(LASET "dim")
(command "line" pt1 pt2 "")
(if (= ang1 (dtr 180))
(progn
(if (= sd "D")
(setq x2 (+ (car dbpt) (* 8.0 ds)))
)
(if (= sd "S")
(setq x2 (car dbpt))
)
)
)
(if (= ang1 0)
(progn
(if (= sd "D")
(setq x2 (- (car dbpt) (* 8.0 ds)))
)
(if (= sd "S")
(setq x2 (car dbpt))
)
)
)
(setq pt (list x2 y2))
(command "insert" "dimdot" pt (* 1.5 ds) "" "")
(if (= sd "D")
(progn
(if (or (= 1 no) (= no (1+ rno)))
(progn
(if (= ang1 (dtr 180))
(progn
(setq pt (list (* -8.0 ds) 0.0))
(command "copy" "last" "" "0,0" pt)
)
)
(if (= ang1 0)
(progn
(setq pt (list (* 8.0 ds) 0.0))
(command "copy" "last" "" "0,0" pt)
)
)
)
)
)
)
(setq no (1+ no))
)
(setq pt1 (list (car dbpt) (+ (apply '+ rlist) (* 2.0 ds) (cadr dbpt))))
(setq pt2 (list (car dbpt) (- (cadr dbpt) (* 2.0 ds))))
(command "line" pt1 pt2 "")
(if (= sd "D")
(progn
(if (= ang1 (dtr 180))
(setq pt (list (* 8.0 ds) 0.0))
)
(if (= ang1 0)
(setq pt (list (* -8.0 ds) 0.0))
)
(command "copy" "last" "" "0,0" pt)
)
)
; DWG dimsion-text
(LASET "dim")
(setq dist 0)
(if (= ang1 (dtr 180))
(progn
(if (= sd "D")
(progn
(setq l (append '(0.0) rlist))
(setq x1 (+ (car dbpt) (* 7.0 ds))
y1 (cadr dbpt))
)
)
(if (= sd "S")
(setq y1 (cadr dbpt))
)
)
)
(if (= ang1 0)
(progn
(if (= sd "D")
(setq l (append '(0.0) rlist))
)
(if (= sd "S")
(setq y1 (cadr dbpt))
)
)
)
(if (= sd "D")
(progn
(setq no 1)
(repeat (1+ rno)
(if (= no 1)
(progn
(setq y2 (+ (cadr dbpt) (/ (apply '+ rlist) 2)))
(setq x2 (- (car dbpt) (* 1.0 ds)))
(setq txt (apply '+ rlist))
(setq txt (txtcon txt))
(setq pt (list x2 y2))
(setq h (* 3.0 ds))
(command "text" "c" pt h "90" txt)
)
(progn
(setq txt (nth (1- no) l))
(if (= ang1 (dtr 180))
(setq y2 (+ y1 dist (/ txt 2)))
)
(if (= ang1 0)
(setq y2 (+ (cadr dbpt) dist (/ txt 2)))
)
(if (= ang1 (dtr 180))
(setq x2 (+ (car dbpt) (* 7.0 ds)))
)
(if (= ang1 0)
(setq x2 (- (car dbpt) (* 9.0 ds)))
)
(setq dist (+ txt dist))
(setq txt (txtcon txt))
(setq pt (list x2 y2))
(setq h (* 3.0 ds))
(command "text" "c" pt h "90" txt)
)
)
(setq no (1+ no))
)
)
)
(if (= sd "S")
(progn
(setq no 0)
(repeat rno
(setq txt (nth no rlist))
(setq y2 (+ y1 dist (/ txt 2)))
(setq x2 (- (car dbpt) (* 1.0 ds)))
(setq dist (+ txt dist))
(setq txt (txtcon txt))
(setq pt (list x2 y2))
(setq h (* 3.0 ds))
(command "text" "c" pt h "90" txt)
(setq no (1+ no))
)
)
)
; DWG Column-bubbles
(setq a (strcase (getstring "\n>>> Do you want to draw column-bubbles? <n> : ")))
(if (= a "Y")
(progn
(setq no 1)
(setq l (append '(0.0) rlist))
(setq dist 0)
(if (= ang1 (dtr 180))
(setq x1 (- (car dbpt) (* 6.0 ds)))
)
(if (= ang1 0)
(setq x1 (+ (car dbpt) (* 6.0 ds)))
)
(setq y1 (cadr dbpt))
(repeat (1+ rno)
(setq dist (+ dist (nth (1- no) l)))
(setq y2 (+ y1 dist))
(setq pt (list x1 y2))
(if (= ang1 (dtr 180))
(setq ang "90")
)
(if (= ang1 0)
(setq ang "270")
)
(bip pt ds ang)
(setq a (strcase (getstring "\n>>> Here? <Column Number or No!> : ")))
(if (= a "N")
(command "erase" "last" "")
(progn
(if (= sd "D")
(progn
(if (= ang1 (dtr 180))
(setq pt (list (- x1 (* 11.00 ds)) y2))
)
(if (= ang1 0)
(setq pt (list (+ x1 (* 11.00 ds)) y2))
)
)
)
(if (= sd "S")
(progn
(if (= ang1 (dtr 180))
(setq pt (list (- x1 (* 11.00 ds)) y2))
)
(if (= ang1 0)
(setq pt (list (+ x1 (* 11.00 ds)) y2))
)
)
)
(setq txt a)
(setq h (* 4.0 ds))
(setq ang "0")
(dbt pt h ang txt)
)
)
(setq no (1+ no))
)
)
)
)
; Main Program
(defun C:DV(/ pt l no no1 no2 a dist os)
(princ ">>> [DV] Vertical dimsion+Line.....")
(setvar "orthomode" 1)
(setvar "cmdecho" 0)
(SETQ Q:LAINIT (GETVAR "CLAYER"))
(setq ds1 (getvar "dimscale"))
(if (<= ds1 600)
(setq ds (* 1.0 ds1))
)
(if (> ds1 600)
(setq ds (* 0.6666666 ds1))
)
(command "style" "romans" "" "0" "" "" "" "" "")
(initget 1 "S D ")
(if (= sd nil) (setq sd "S"))
(setq sd1 (getkword (strcat "\n>>> <S>ingle or <D>ouble [" sd "] :")))
(if (member sd1 '("S" "D")) (setq sd sd1))
(setvar "blipmode" 1)
(setvar "osmode" 1)
(initget 1)
(setq bpt (getpoint "\n>>> Pick Basepoint :"))
(setq rlist '())
(setq rno 0)
(setq pt bpt)
(while pt
(setq no1 (itoa rno) no2 (itoa (1+ rno)))
(setq a (strcat no1 " and " no2 ": "))
(setvar "osmode" 128)
(princ "\n>>> Pick Next Point :")
(princ a)
(setq dist (getdist pt))
(if dist
(progn
(setq pt (polar pt (/ pi 2.0) dist))
(setq dist (list dist))
(setq rlist (append rlist dist))
(setq rno (1+ rno))
)
(setq pt nil)
)
)
(setvar "osmode" 0)
(dwgdimrl)
(LASET Q:LAINIT)
(command "style" "romans" "" "0" "" "" "" "" "")
(setvar "cmdecho" 1)
(setvar "blipmode" 1)
(prin1)
)
1. 이 리습은 치수가 블럭화되어 있지않고 그냥 치수선과 치수문자가
분리되어 그려줍니다.
2. 단선치수,및 다중치수가 가능하고요
치수선끝에 버블및 주열번호까지 한번에 그릴수있습니다.
3. 수평칫수-DH명령 상하부에 그릴수있고요
수직치수-DV영령 좌우측에 그릴수있어요
R14에서는 사용가능 하고요
2000에서는 치수선만 그려지고 치수text가 안써지면서 이런 메세지가뜨네요
error: incorrect object to bind: T
참 좋은 리습인데 그냥 버리기가 넘아까워요
아무리봐도 이상해요
R11부터 R14까지 잘 쓰던것이 왜 안되는지.
파일을 올리려고 하는데 사용권한이 없데요?
파일 올리느데도 권한이 필요한가요??
하수연님, 추운겨울님 관심 가져주셔서 고맙습니다.
버블과도트(dwg)는 메일 보내수심 보내드릴께요
(dollpagu@yahoo.co.kr)
고수님들 부탁좀 드릴께요.
수평칫수-DH소스
(DEFUN LASET (Q:LA / Z)
(if (TBLSEARCH "LAYER" Q:LA)
(COMMAND "LAYER" "S" Q:LA "")
(COMMAND "LAYER" "M" Q:LA "")
)
)
; dimsion Text Conversion Sub-Program
(defun txtcon(txt / n no n1 n2 txts t tt)
(setq tt (rtos txt 2 0))
(setq n (strlen tt))
(if (> n 3)
(progn
(setq n1 (rem n 3))
(setq n2 (/ (- n n1) 3))
(setq no 1)
(setq txts "")
(repeat (1+ n2)
(if (< no (1+ n2))
(setq t (strcat "." (substr tt (- (1+ n) (* 3 no)) 3)))
(setq t (substr tt 1 n1))
)
(setq txts (strcat t txts))
(setq no (1+ no))
)
(setq txt txts)
)
(setq txt tt)
)
)
; Bubble Inserting Sub-Program
(defun bip(pt scf ang)
(LASET "dim")
(command "insert" "bubble" pt ds "" ang)
)
; Drawing Bubble-text Sub-program
(defun dbt(pt h ang txt)
(LASET "dim")
(command "text" "m" pt h ang txt)
)
; Downside dimsion Line DWG. Program
(defun dwgdimud(/ dbpt no dist x1 x2 y1 y2 l pt1 pt2 pt h ang)
(princ "\n ")
(setq dbpt (getpoint "\n>>> Location of Horizontal dimsion :"))
(setvar "blipmode" 0)
(setq dbpt (list (car bpt) (cadr dbpt)))
(setq ang1 (angle bpt dbpt))
(setq no 1)
(setq dist 0)
(setq l (append '(0.0) clist))
(setq x1 (car dbpt))
(if (= ang1 (dtr 270))
(setq y1 (- (cadr bpt) (* 3.0 ds)))
)
(if (= ang1 (dtr 90))
(setq y1 (+ (cadr bpt) (* 3.0 ds)))
)
(repeat (1+ cno)
(if (= ang1 (dtr 270))
(progn
(if (= sd "D")
(if (and (< 1 no) (< no (1+ cno)))
(setq y2 (+ (cadr dbpt) (* 6.0 ds)))
(setq y2 (- (cadr dbpt) (* 2.0 ds)))
)
)
(if (= sd "S")
(setq y2 (- (cadr dbpt) (* 2.0 ds)))
)
)
)
(if (= ang1 (dtr 90))
(progn
(if (= sd "D")
(if (and (< 1 no) (< no (1+ cno)))
(setq y2 (- (cadr dbpt) (* 6.0 ds)))
(setq y2 (+ (cadr dbpt) (* 2.0 ds)))
)
)
(if (= sd "S")
(setq y2 (+ (cadr dbpt) (* 2.0 ds)))
)
)
)
(setq dist (+ dist (nth (1- no) l)))
(setq x2 (+ x1 dist))
(setq pt1 (list x2 y1))
(setq pt2 (list x2 y2))
(LASET "dim")
(command "line" pt1 pt2 "")
(if (= ang1 (dtr 270))
(progn
(if (= sd "D")
(setq y2 (+ (cadr dbpt) (* 8.0 ds)))
)
(if (= sd "S")
(setq y2 (cadr dbpt))
)
)
)
(if (= ang1 (dtr 90))
(progn
(if (= sd "D")
(setq y2 (- (cadr dbpt) (* 8.0 ds)))
)
(if (= sd "S")
(setq y2 (cadr dbpt))
)
)
)
(setq pt (list x2 y2))
(command "insert" "dimdot" pt (* 1.5 ds) "" "")
(if (= sd "D")
(progn
(if (or (= 1 no) (= no (1+ cno)))
(progn
(if (= ang1 (dtr 270))
(progn
(setq pt (list 0.0 (* -8.0 ds)))
(command "copy" "last" "" "0,0" pt)
)
)
(if (= ang1 (dtr 90))
(progn
(setq pt (list 0.0 (* 8.0 ds)))
(command "copy" "last" "" "0,0" pt)
)
)
)
)
)
)
(setq no (1+ no))
)
(setq pt1 (list (- (car dbpt) (* 2.0 ds)) (cadr dbpt)))
(setq pt2 (list (+ (car dbpt) (apply '+ clist) (* 2.0 ds)) (cadr dbpt)))
(command "line" pt1 pt2 "")
(if (= sd "D")
(progn
(if (= ang1 (dtr 270))
(setq pt (list 0.0 (* 8.0 ds)))
)
(if (= ang1 (dtr 90))
(setq pt (list 0.0 (* -8.0 ds)))
)
(command "copy" "last" "" "0,0" pt)
)
)
; DWG dimsion-text
(LASET "dim")
(setq no 1)
(setq dist 0)
(setq l (append '(0.0) clist))
(if (= ang1 (dtr 270))
(if (= sd "S")
(setq x1 (car dbpt))
)
)
(if (= ang1 (dtr 90))
(setq x1 (car dbpt)
y1 (- (cadr dbpt) (* 7.0 ds))
)
)
(if (= sd "D")
(progn
(repeat (1+ cno)
(if (= no 1)
(progn
(setq y2 (+ (cadr dbpt) (* 1.0 ds)))
(setq x2 (+ (car dbpt) (/ (apply '+ clist) 2)))
(setq txt (apply '+ clist))
(setq txt (txtcon txt))
(setq pt (list x2 y2))
(setq h (* 3.0 ds))
(command "text" "c" pt h "0" txt)
)
(progn
(if (= ang1 (dtr 270))
(setq y2 (+ (cadr dbpt) (* 9.0 ds)))
)
(if (= ang1 (dtr 90))
(setq y2 (- (cadr dbpt) (* 7.0 ds)))
)
(setq txt (nth (1- no) l))
(if (= ang1 (dtr 270))
(setq x2 (+ (car dbpt) dist (/ txt 2)))
)
(if (= ang1 (dtr 90))
(setq x2 (+ x1 dist (/ txt 2)))
)
(setq dist (+ txt dist))
(setq txt (txtcon txt))
(setq pt (list x2 y2))
(setq h (* 3.0 ds))
(command "text" "c" pt h "0" txt)
)
)
(setq no (1+ no))
)
)
)
(if (= sd "S")
(progn
(repeat cno
(setq y2 (+ (cadr dbpt) (* 1.0 ds)))
(setq txt (nth no l))
(setq x2 (+ x1 dist (/ txt 2)))
(setq dist (+ txt dist))
(setq txt (txtcon txt))
(setq pt (list x2 y2))
(setq h (* 3.0 ds))
(command "text" "c" pt h "0" txt)
(setq no (1+ no))
)
)
)
; DWG Column-bubbles
(setq a (strcase (getstring "\n>>> Do you want to draw column-bubbles? <n> : ")))
(if (= a "Y")
(progn
(setq no 1)
(setq l (append '(0.0) clist))
(setq dist 0)
(setq x1 (car dbpt))
(if (= ang1 (dtr 270))
(setq y1 (- (cadr dbpt) (* 6.0 ds)))
)
(if (= ang1 (dtr 90))
(setq y1 (+ (cadr dbpt) (* 6.0 ds)))
)
(repeat (1+ cno)
(setq dist (+ dist (nth (1- no) l)))
(setq x2 (+ x1 dist))
(setq pt (list x2 y1))
(if (= ang1 (dtr 270))
(setq ang "180")
)
(if (= ang1 (dtr 90))
(setq ang "0")
)
(bip pt ds ang)
(setq a (strcase (getstring "\n>>> Here? <Column Number or No!> : ")))
(if (= a "N")
(command "erase" "last" "")
(progn
(if (= sd "D")
(progn
(if (= ang1 (dtr 270))
(setq pt (list x2 (- y2 (* 26.02 ds))))
)
(if (= ang1 (dtr 90))
(setq pt (list x2 (+ y2 (* 24.01 ds))))
)
)
)
(if (= sd "S")
(progn
(if (= ang1 (dtr 270))
(setq pt (list x2 (- y2 (* 18.02 ds))))
)
(if (= ang1 (dtr 90))
(setq pt (list x2 (+ y2 (* 16.01 ds))))
)
)
)
(setq txt a)
(setq h (* 4.0 ds))
(if (= ang1 (dtr 270))
(setq ang "0")
)
(dbt pt h ang txt)
)
)
(setq no (1+ no))
)
)
)
)
; Main Program
(defun C:DH(/ pt l no no1 no2 a dist os)
(princ ">>> [DH] Horizon dimsion+Line.....")
(setvar "cmdecho" 0)
(SETQ Q:LAINIT (GETVAR "CLAYER"))
(setvar "orthomode" 1)
(setq ds1 (getvar "dimscale"))
(if (<= ds1 600)
(setq ds (* 1.0 ds1))
)
(if (> ds1 600)
(setq ds (* 0.6666666 ds1))
)
(command "style" "romans" "" "0" "" "" "" "" "")
(initget 1 "S D ")
(if (= sd nil) (setq sd "S"))
(setq sd1 (getkword (strcat "\n>>> <S>ingle or <D>ouble [" sd "] :")))
(if (member sd1 '("S" "D")) (setq sd sd1))
(setvar "blipmode" 1)
(setvar "osmode" 1)
(initget 1)
(setq bpt (getpoint "\n>>> Pick Basepoint :"))
(setq clist '())
(setq cno 0)
(setq pt bpt)
(while pt
(setq no1 (itoa cno) no2 (itoa (1+ cno)))
(setq a (strcat no1 " and " no2 ": "))
(setvar "osmode" 128)
(princ "\n>>> Pick Next Point :")
(princ a)
(setq dist (getdist pt))
(if dist
(progn
(setq pt (polar pt 0.0 dist))
(setq dist (list dist))
(setq clist (append clist dist))
(setq cno (1+ cno))
)
(setq pt nil)
)
)
(setvar "osmode" 0)
(dwgdimud)
(LASET Q:LAINIT)
(command "style" "romans" "" "0" "" "" "" "" "")
(setvar "cmdecho" 1)
(setvar "blipmode" 1)
(prin1)
)
수직칫수-DV소스
(DEFUN LASET (Q:LA / Z)
(if (TBLSEARCH "LAYER" Q:LA)
(COMMAND "LAYER" "S" Q:LA "")
(COMMAND "LAYER" "M" Q:LA "")
)
)
; Downside dimsion Line DWG. Program
(defun dwgdimrl(/ dbpt no dist x1 x2 y1 y2 l pt1 pt2 pt h ang)
(princ "\n ")
(setq dbpt (getpoint "\n>>>Location of Vertical dimsion :"))
(setvar "blipmode" 0)
(setq dbpt (list (car dbpt) (cadr bpt)))
(setq ang1 (angle bpt dbpt))
(setq no 1)
(setq dist 0)
(setq l (append '(0.0) rlist))
(if (= ang1 (dtr 180))
(setq x1 (- (car bpt) (* 3.0 ds)))
)
(if (= ang1 0)
(setq x1 (+ (car bpt) (* 3.0 ds)))
)
(setq y1 (cadr dbpt))
(repeat (1+ rno)
(if (= ang1 (dtr 180))
(progn
(if (= sd "D")
(if (and (< 1 no) (< no (1+ rno)))
(setq x2 (+ (car dbpt) (* 6.0 ds)))
(setq x2 (- (car dbpt) (* 2.0 ds)))
)
)
(if (= sd "S")
(setq x2 (- (car dbpt) (* 2.0 ds)))
)
)
)
(if (= ang1 0)
(progn
(if (= sd "D")
(if (and (< 1 no) (< no (1+ rno)))
(setq x2 (- (car dbpt) (* 6.0 ds)))
(setq x2 (+ (car dbpt) (* 2.0 ds)))
)
)
(if (= sd "S")
(setq x2 (+ (car dbpt) (* 2.0 ds)))
)
)
)
(setq dist (+ dist (nth (1- no) l)))
(setq y2 (+ y1 dist))
(setq pt1 (list x1 y2))
(setq pt2 (list x2 y2))
(LASET "dim")
(command "line" pt1 pt2 "")
(if (= ang1 (dtr 180))
(progn
(if (= sd "D")
(setq x2 (+ (car dbpt) (* 8.0 ds)))
)
(if (= sd "S")
(setq x2 (car dbpt))
)
)
)
(if (= ang1 0)
(progn
(if (= sd "D")
(setq x2 (- (car dbpt) (* 8.0 ds)))
)
(if (= sd "S")
(setq x2 (car dbpt))
)
)
)
(setq pt (list x2 y2))
(command "insert" "dimdot" pt (* 1.5 ds) "" "")
(if (= sd "D")
(progn
(if (or (= 1 no) (= no (1+ rno)))
(progn
(if (= ang1 (dtr 180))
(progn
(setq pt (list (* -8.0 ds) 0.0))
(command "copy" "last" "" "0,0" pt)
)
)
(if (= ang1 0)
(progn
(setq pt (list (* 8.0 ds) 0.0))
(command "copy" "last" "" "0,0" pt)
)
)
)
)
)
)
(setq no (1+ no))
)
(setq pt1 (list (car dbpt) (+ (apply '+ rlist) (* 2.0 ds) (cadr dbpt))))
(setq pt2 (list (car dbpt) (- (cadr dbpt) (* 2.0 ds))))
(command "line" pt1 pt2 "")
(if (= sd "D")
(progn
(if (= ang1 (dtr 180))
(setq pt (list (* 8.0 ds) 0.0))
)
(if (= ang1 0)
(setq pt (list (* -8.0 ds) 0.0))
)
(command "copy" "last" "" "0,0" pt)
)
)
; DWG dimsion-text
(LASET "dim")
(setq dist 0)
(if (= ang1 (dtr 180))
(progn
(if (= sd "D")
(progn
(setq l (append '(0.0) rlist))
(setq x1 (+ (car dbpt) (* 7.0 ds))
y1 (cadr dbpt))
)
)
(if (= sd "S")
(setq y1 (cadr dbpt))
)
)
)
(if (= ang1 0)
(progn
(if (= sd "D")
(setq l (append '(0.0) rlist))
)
(if (= sd "S")
(setq y1 (cadr dbpt))
)
)
)
(if (= sd "D")
(progn
(setq no 1)
(repeat (1+ rno)
(if (= no 1)
(progn
(setq y2 (+ (cadr dbpt) (/ (apply '+ rlist) 2)))
(setq x2 (- (car dbpt) (* 1.0 ds)))
(setq txt (apply '+ rlist))
(setq txt (txtcon txt))
(setq pt (list x2 y2))
(setq h (* 3.0 ds))
(command "text" "c" pt h "90" txt)
)
(progn
(setq txt (nth (1- no) l))
(if (= ang1 (dtr 180))
(setq y2 (+ y1 dist (/ txt 2)))
)
(if (= ang1 0)
(setq y2 (+ (cadr dbpt) dist (/ txt 2)))
)
(if (= ang1 (dtr 180))
(setq x2 (+ (car dbpt) (* 7.0 ds)))
)
(if (= ang1 0)
(setq x2 (- (car dbpt) (* 9.0 ds)))
)
(setq dist (+ txt dist))
(setq txt (txtcon txt))
(setq pt (list x2 y2))
(setq h (* 3.0 ds))
(command "text" "c" pt h "90" txt)
)
)
(setq no (1+ no))
)
)
)
(if (= sd "S")
(progn
(setq no 0)
(repeat rno
(setq txt (nth no rlist))
(setq y2 (+ y1 dist (/ txt 2)))
(setq x2 (- (car dbpt) (* 1.0 ds)))
(setq dist (+ txt dist))
(setq txt (txtcon txt))
(setq pt (list x2 y2))
(setq h (* 3.0 ds))
(command "text" "c" pt h "90" txt)
(setq no (1+ no))
)
)
)
; DWG Column-bubbles
(setq a (strcase (getstring "\n>>> Do you want to draw column-bubbles? <n> : ")))
(if (= a "Y")
(progn
(setq no 1)
(setq l (append '(0.0) rlist))
(setq dist 0)
(if (= ang1 (dtr 180))
(setq x1 (- (car dbpt) (* 6.0 ds)))
)
(if (= ang1 0)
(setq x1 (+ (car dbpt) (* 6.0 ds)))
)
(setq y1 (cadr dbpt))
(repeat (1+ rno)
(setq dist (+ dist (nth (1- no) l)))
(setq y2 (+ y1 dist))
(setq pt (list x1 y2))
(if (= ang1 (dtr 180))
(setq ang "90")
)
(if (= ang1 0)
(setq ang "270")
)
(bip pt ds ang)
(setq a (strcase (getstring "\n>>> Here? <Column Number or No!> : ")))
(if (= a "N")
(command "erase" "last" "")
(progn
(if (= sd "D")
(progn
(if (= ang1 (dtr 180))
(setq pt (list (- x1 (* 11.00 ds)) y2))
)
(if (= ang1 0)
(setq pt (list (+ x1 (* 11.00 ds)) y2))
)
)
)
(if (= sd "S")
(progn
(if (= ang1 (dtr 180))
(setq pt (list (- x1 (* 11.00 ds)) y2))
)
(if (= ang1 0)
(setq pt (list (+ x1 (* 11.00 ds)) y2))
)
)
)
(setq txt a)
(setq h (* 4.0 ds))
(setq ang "0")
(dbt pt h ang txt)
)
)
(setq no (1+ no))
)
)
)
)
; Main Program
(defun C:DV(/ pt l no no1 no2 a dist os)
(princ ">>> [DV] Vertical dimsion+Line.....")
(setvar "orthomode" 1)
(setvar "cmdecho" 0)
(SETQ Q:LAINIT (GETVAR "CLAYER"))
(setq ds1 (getvar "dimscale"))
(if (<= ds1 600)
(setq ds (* 1.0 ds1))
)
(if (> ds1 600)
(setq ds (* 0.6666666 ds1))
)
(command "style" "romans" "" "0" "" "" "" "" "")
(initget 1 "S D ")
(if (= sd nil) (setq sd "S"))
(setq sd1 (getkword (strcat "\n>>> <S>ingle or <D>ouble [" sd "] :")))
(if (member sd1 '("S" "D")) (setq sd sd1))
(setvar "blipmode" 1)
(setvar "osmode" 1)
(initget 1)
(setq bpt (getpoint "\n>>> Pick Basepoint :"))
(setq rlist '())
(setq rno 0)
(setq pt bpt)
(while pt
(setq no1 (itoa rno) no2 (itoa (1+ rno)))
(setq a (strcat no1 " and " no2 ": "))
(setvar "osmode" 128)
(princ "\n>>> Pick Next Point :")
(princ a)
(setq dist (getdist pt))
(if dist
(progn
(setq pt (polar pt (/ pi 2.0) dist))
(setq dist (list dist))
(setq rlist (append rlist dist))
(setq rno (1+ rno))
)
(setq pt nil)
)
)
(setvar "osmode" 0)
(dwgdimrl)
(LASET Q:LAINIT)
(command "style" "romans" "" "0" "" "" "" "" "")
(setvar "cmdecho" 1)
(setvar "blipmode" 1)
(prin1)
)