우선 너무 엉망인 리습을 올려서 죄송합니다.. 아직공부중이라 ^^
;; Read import file
(defun C:SBL (/ in_file file_name SBL SBL_id )
(SETVAR “ORTHOMODE” 1)
(setvar “dimzin” 0)
(setq file_name (getfiled “smaple (TEXT 파일을 지정하세요)” “” “txt” 8) )
(setq in_file (open file_name “r”))
(setq SBL nil)
(setq SBL_list nil)
(while
(setq temp (read-char in_file))
(if (= temp (ascii “#”)) ;
(progn
(setq buffer (read-line in_file))
(setq SBL_id buffer)
(setq SBL_id (strcase SBL_id))
;SLAB NO.—————————
(setq a1 (read-line in_file))
;THK.—————————
(setq b1 (read-line in_file))
;TYPE—————————
(setq c1 (read-line in_file))
;A—————————
(setq d1 (read-line in_file))
;A’—————————
(setq e1 (read-line in_file))
;B—————————
(setq f1 (read-line in_file))
;C—————————
(setq g1 (read-line in_file))
;C’—————————
(setq h1 (read-line in_file))
;D—————————
(setq I1 (read-line in_file))
;E—————————
(setq J1 (read-line in_file))
;E’—————————
(setq K1 (read-line in_file))
;F—————————
(setq L1 (read-line in_file))
;G—————————
(setq M1 (read-line in_file))
;G’—————————
(setq O1 (read-line in_file))
;H ————————–
(setq Q1 (read-line in_file))
;REMARK—————————
(setq R1 (read-line in_file))
;:============================================================
(setq SBL (list SBL_id a1 b1 c1 d1 e1 f1 g1 h1 i1 j1 k1 l1 m1 o1 q1 r1))
(setq SBL_list (cons SBL SBL_list))
) ; progn
) ; if
) ;while
;:============================================================
;:============================================================
;; Make SBL
(defun dtr(a) (* pi (/ a 180.0))) ; *** 디그리각도 변환 *** ;
(defun rtd(b) (/ (* b 180) pi)) ; *** 라디안각 변환 *** ;
(graphscr)
(setvar “cmdecho” 0)
(setvar “blipmode” 0)
(if (= SBL_list nil)
(prompt “n *You must import data file using rf “)
)
;:============================================================
;:============================================================
(setq no 1)
(setq no (itoa no))
(setvar “osmode” 47)
(setq p1 (getpoint “BOX의 좌측하부를 지정해주세요 :”))(terpri)
(setq p3 (getcorner p1 “BOX의 우측 상부를 지정해 주세요 :”))(terpri)
(setq p2 (list (car p1)(cadr p3)))
(setq p4 (list (car p3)(cadr p1)))
(setq x1 (cadr p1))
(setq x2 (cadr p2))
(setq dx (- x2 x1))
(setq wh (sqrt (+ (* dx dx))))
(setq y1 (car p1))
(setq y2 (car p4))
(setq dy (- y2 y1))
(setq wt (sqrt (+ (* dy dy))))
(setvar “osmode” 0)
;:슬래브 배근일람표 TITLE BOX============================================================
(setq p5 (polar p1 (dtr 90.0) 1200))
(setq p6 (polar p4 (dtr 90.0) 1200))
(setq p7 (polar p4 (dtr 180.0) 1200))
(setq p8 (polar p7 (dtr 90.0) 1200))
(command “clayer” “ELE”)
;(command “pline” p5 p6″”)
;(command “pline” p7 p8″”)
;:슬래브 배근일람표 외각 BOX============================================================
(setq wh2 41000)
(setq p10 (polar p2 (dtr 0.0) 1000))
(setq p11 (polar p10 (dtr 270.0) 1000))
(setq p12 (polar p11 (dtr 270.0) wh2))
(setq p13 (polar p3 (dtr 180.0) 1000))
(setq p14 (polar p13 (dtr 270.0) 1000))
(setq p15 (polar p14 (dtr 270.0) wh2))
;:슬래브 배근일람표 내부 수직 LINE============================================================
(command “clayer” “ML”)
(setq p20 (polar p11 (dtr 0.0) 4200))
(setq p21 (polar p20 (dtr 270.0) WH2))
(command “pline” p20 p21″”)
(setq p22 (polar p20 (dtr 0.0) 2000))
(setq p23 (polar p22 (dtr 270.0) WH2))
(command “pline” p22 p23″”)
(setq p24 (polar p22 (dtr 0.0) 2000))
(setq p25 (polar p24 (dtr 270.0) WH2))
(command “pline” p24 p25″”)
;주의 POINT3 부근 수직 LINE(비 고)———-
(setq p26 (polar p14 (dtr 180.0) 4200))
(setq p27 (polar p26 (dtr 270.0) WH2))
(command “pline” p26 p27″”)
;수직LINE 간격 나머지 거리———-
(setq y3 (car p24))
(setq y4 (car p26))
(setq dy (- y4 y3))
(setq wt1 (sqrt (+ (* dy dy))))
(setq wt2 (/ wt1 12))
(setq wt3 wt2)
;수직LINE 연속부———-
(repeat 11
(setq p30 (polar p24 (dtr 0.0) WT3))
(setq p31 (polar p30 (dtr 270.0) WH2))
(command “pline” p30 p31″”)
(setq wt3 (+ wt3 wt2))
)
;수평LINE========================================================
==============================================================
(setq y5 (car p11))
(setq y6 (car p14))
(setq dy (- y6 y5))
(setq wt4 (sqrt (+ (* dy dy))))
(setq p50 (polar p11 (dtr 270.0) 1000))
(setq p51 (polar p50 (dtr 0.0) wt4))
(command “pline” p50 p51″”)
;TITLE TEXT========================================================
(command “clayer” “TEXT”)
(command “-STYLE” “” “” “” “0.8” “” “” “” “”)
(setq tx1 “SLAB NO.”)
(setq p60 (polar p11 (dtr 0.0) 2100))
(setq p61 (polar p60 (dtr 270.0) 500))
(command “text” “J” “MC” p61 “350” “0” tx1 “”)
(setq tx2 “THK.”)
(setq p62 (polar p20 (dtr 0.0) 1000))
(setq p63 (polar p62 (dtr 270.0) 500))
(command “text” “J” “MC” p63 “350” “0” tx2 “”)
(setq tx3 “TYPE”)
(setq p64 (polar p22 (dtr 0.0) 1000))
(setq p65 (polar p64 (dtr 270.0) 500))
(command “text” “J” “MC” p65 “350” “0” tx3 “”)
(setq wt3 (/ wt2 2))
(setq tx4 “A”)
(setq p66 (polar p24 (dtr 0.0) wt3))
(setq p67 (polar p66 (dtr 270.0) 500))
(command “text” “J” “MC” p67 “350” “0” tx4 “”)
(setq tx5 “A'”)
(setq p68 (polar p67 (dtr 0.0) wt2))
(command “text” “J” “MC” p68 “350” “0” tx5 “”)
(setq tx6 “B”)
(setq p69 (polar p68 (dtr 0.0) wt2))
(command “text” “J” “MC” p69 “350” “0” tx6 “”)
(setq tx7 “C”)
(setq p70 (polar p69 (dtr 0.0) wt2))
(command “text” “J” “MC” p70 “350” “0” tx7 “”)
(setq tx8 “C'”)
(setq p71 (polar p70 (dtr 0.0) wt2))
(command “text” “J” “MC” p71 “350” “0” tx8 “”)
(setq tx9 “D”)
(setq p72 (polar p71 (dtr 0.0) wt2))
(command “text” “J” “MC” p72 “350” “0” tx9 “”)
(setq tx10 “E”)
(setq p73 (polar p72 (dtr 0.0) wt2))
(command “text” “J” “MC” p73 “350” “0” tx10 “”)
(setq tx11 “E'”)
(setq p74 (polar p73 (dtr 0.0) wt2))
(command “text” “J” “MC” p74 “350” “0” tx11 “”)
(setq tx12 “F”)
(setq p75 (polar p74 (dtr 0.0) wt2))
(command “text” “J” “MC” p75 “350” “0” tx12 “”)
(setq tx13 “G”)
(setq p76 (polar p75 (dtr 0.0) wt2))
(command “text” “J” “MC” p76 “350” “0” tx13 “”)
(setq tx14 “G'”)
(setq p77 (polar p76 (dtr 0.0) wt2))
(command “text” “J” “MC” p77 “350” “0” tx14 “”)
(setq tx15 “H”)
(setq p78 (polar p77 (dtr 0.0) wt2))
(command “text” “J” “MC” p78 “350” “0” tx15 “”)
(setq tx16 “REMARK”)
(setq p79 (polar p14 (dtr 180.0) 2100))
(setq p80 (polar p79 (dtr 270.0) 500))
(command “text” “J” “MC” p80 “350” “0” tx16 “”)
;내부 배근 TEXT========================================================
======================================================================
======================================================================
(setq wh3 800)
(setq wh4 wh3)
(setq wt5 (+ wt3 1000))
(setq wt6 (/ wt2 2))
(setq wt7 (+ wt6 2100))
(setq ST 400)
(repeat 50
(setq no (strcase no))
(setq target_SBL (assoc no SBL_list ))
(setq a1 (nth 1 target_SBL))
(setq b1 (nth 2 target_SBL))
(setq c1 (nth 3 target_SBL))
(setq d1 (nth 4 target_SBL))
(setq e1 (nth 5 target_SBL))
(setq f1 (nth 6 target_SBL))
(setq g1 (nth 7 target_SBL))
(setq h1 (nth 8 target_SBL))
(setq i1 (nth 9 target_SBL))
(setq j1 (nth 10 target_SBL))
(setq k1 (nth 11 target_SBL))
(setq l1 (nth 12 target_SBL))
(setq m1 (nth 13 target_SBL))
(setq o1 (nth 14 target_SBL))
(setq q1 (nth 15 target_SBL))
(setq r1 (nth 16 target_SBL))
;SLAB NO.=======================================
(setq p100 (polar p50 (dtr 0.0) 2100))
(setq p101 (polar p100 (dtr 270.0) ST))
(command “text” “J” “MC” p101 “300” “0” a1 “”)
;THK.=======================================
(setq p102 (polar p101 (dtr 0.0) 3100))
(command “text” “J” “MC” p102 “300” “0” b1 “”)
;THK.=======================================
(setq p103 (polar p102 (dtr 0.0) 2000))
(command “text” “J” “MC” p103 “300” “0” c1 “”)
;A=======================================
(setq p104 (polar p103 (dtr 0.0) WT5))
(command “text” “J” “MC” p104 “300” “0” d1 “”)
;A’=======================================
(setq p105 (polar p104 (dtr 0.0) WT2))
(command “text” “J” “MC” p105 “300” “0” e1 “”)
;B=======================================
(setq p106 (polar p105 (dtr 0.0) WT2))
(command “text” “J” “MC” p106 “300” “0” f1 “”)
;C=======================================
(setq p107 (polar p106 (dtr 0.0) WT2))
(command “text” “J” “MC” p107 “300” “0” g1 “”)
;C’=======================================
(setq p108 (polar p107 (dtr 0.0) WT2))
(command “text” “J” “MC” p108 “300” “0” h1 “”)
;D=======================================
(setq p109 (polar p108 (dtr 0.0) WT2))
(command “text” “J” “MC” p109 “300” “0” I1 “”)
;E=======================================
(setq p110 (polar p109 (dtr 0.0) WT2))
(command “text” “J” “MC” p110 “300” “0” J1 “”)
;E’=======================================
(setq p111 (polar p110 (dtr 0.0) WT2))
(command “text” “J” “MC” p111 “300” “0” K1 “”)
;F=======================================
(setq p112 (polar p111 (dtr 0.0) WT2))
(command “text” “J” “MC” p112 “300” “0” L1 “”)
;G=======================================
(setq p113 (polar p112 (dtr 0.0) WT2))
(command “text” “J” “MC” p113 “300” “0” M1 “”)
;G’=======================================
(setq p114 (polar p113 (dtr 0.0) WT2))
(command “text” “J” “MC” p114 “300” “0” O1 “”)
;H=======================================
(setq p115 (polar p114 (dtr 0.0) WT2))
(command “text” “J” “MC” p115 “300” “0” Q1 “”)
;REMARK=======================================
(setq p116 (polar p115 (dtr 0.0) WT7))
(command “text” “J” “MC” p116 “300” “0” R1 “”)
;;==============================================
;수평LINE 연속부———-
(command “clayer” “ELE”)
(setq p120 (polar p100 (dtr 180.0) 2100))
(setq p121 (polar p120 (dtr 270.0) wh4))
(setq p122 (polar p121 (dtr 0.0) wt4))
(command “pline” p121 p122″”)
(setq no (atoi no))
(setq no1 (+ no 1))
(setq no no1)
(setq no (itoa no))
(setq ST (+ ST 800))
(command “clayer” “text”)
(setq wh4 (+ wh4 800))
)
(setq p123 (polar p121 (dtr 270.0) 800))
(setq p124 (polar p122 (dtr 270.0) 800))
(command “clayer” “t”)
(command “pline” p11 p123 p124 p14 p11″”)
(command “clayer” “0”)
(setvar “osmode” 47)
(princ))
이상이 본문이고요 제가 궁금한것은 맨마지막에 pline을 그리는 명령이 먹히질 않습니다. repeat이 돌아가다가 더이상 내용이 없으니까 에러가 나면서 그후에 리습을 읽지 않는것 같은데 어떻게 처리해야 될지를 모르겠습니다…^^ 살짝 수정을 해주시면 더많은 공부가 될것같습니다. 말로 설명을 적어주시면 이해하기가 힘들어서 ㅜㅜ 그럼 고수님들의 많은 도움 부탁드립니다.
text 파일도 함께 올려봅니다 ^^