비밀번호를 잊으셨나요?

비밀번호를 잊으셨나요? 비밀번호를 재설정하려면 이메일 주소를 입력해주세요.

계정이 있나요? 로그인

You must login to ask a question.

비밀번호를 잊으셨나요?

아직 계정이 없으신가요? 회원가입 하기

해당 질문을 신고하는 이유를 간단히 입력해주세요.

해당 답변을 신고하는 이유를 간단히 입력해주세요.

해당 유저를 신고하는 이유를 간단히 입력해주세요.

로그인회원가입

고캐드 – 캐드(CAD) 정보의 중심

고캐드 – 캐드(CAD) 정보의 중심 Logo 고캐드 – 캐드(CAD) 정보의 중심 Logo

고캐드 – 캐드(CAD) 정보의 중심 Navigation

  • Q&A
    • AutoCAD & CADian
    • Inventor & Solidworks
    • Revit & ArchiCAD
    • 자유질문
    • 기타
  • 커뮤니티
    • 오늘의이슈
    • 자유게시판
    • 익명게시판
    • 건의게시판
  • 자료실
    • 자료요청
    • 일반파일
    • 도면샘플
    • 유틸리티
    • 기타
  • 작품 갤러리
    • 그래픽
    • 캐드도면
    • 3D모델
    • 기타
  • 뉴스&이벤트
    • 공지사항
    • 뉴스
    • 전시/행사
    • 이벤트
    • 기타
검색
질문하기

Mobile menu

닫기
질문하기
  • 홈
  • 카테고리
    • AutoCAD & CADian
    • Inventor & Solidworks
    • Revit & ArchiCAD
    • 자유질문
    • 기타
  • 투표
  • 커뮤니티 그룹
  • Q&A
    • AutoCAD & CADian
    • Inventor & Solidworks
    • Revit & ArchiCAD
    • 자유질문
    • 기타
  • 커뮤니티
    • 오늘의이슈
    • 자유게시판
    • 익명게시판
    • 건의게시판
  • 자료실
    • 자료요청
    • 일반파일
    • 도면샘플
    • 유틸리티
    • 기타
  • 작품 갤러리
    • 그래픽
    • 캐드도면
    • 3D모델
    • 기타
  • 뉴스&이벤트
    • 공지사항
    • 뉴스
    • 전시/행사
    • 이벤트
    • 기타
홈/ 질문/Q 79318
다음
Lv.0
등록일: 2008-12-102008-12-10T13:28:50+09:00 2008-12-10T13:28:50+09:00카테고리: AutoCAD & CADian

수량집계시 규격란에 공백이 생기네요… 어떻게 하면 공백없이 쓸수 있나요.. 수정부탁

(vmon)
(defun *error* (s)


  (setvar “cmdecho” 1)
  (setvar “blipmode” 1)
  (setvar “clayer” old_layer)
  (setvar “filedia” 1)
  (if (or (= s “quit / exit abort”) (= s “console break”))
      (princ (strcat “nError:” s))) ;if
  (princ)
) ;defun error function
;—————————————————————————–
(defun StrToLst (at_lst / out_lst)


   (setq out_lst (list (atoi (substr at_lst 1 1)) (substr at_lst 2 18)
                        (substr at_lst 20 20) (atoi (substr at_lst 41)))) ;setq
) ;defun sub function: Change string to list
;—————————————————————————–
(defun PlusLst (lst_a / lst_1 lst_2 lst_b lst_c out_lst)


   (setq lst_1 (car lst_a)
         lst_c nil)
   (while lst_1
      (setq lst_a (cdr lst_a)
            lst_2 (car lst_a))      
      (while lst_2
         (if (and (= (car lst_1) (car lst_2)) (= (cadr lst_1) (cadr lst_2)))
             (setq lst_1 (subst (+ (last lst_1) (last lst_2)) (last lst_1) lst_1))
             (setq lst_b (cons lst_2 lst_b)));if
         (setq lst_a (cdr lst_a)
                lst_2 (car lst_a))) ;while
     (setq lst_c (cons lst_1 lst_c)
           lst_a lst_b
           lst_b nil
           lst_1 (car lst_a))) ;while
   (setq lst_a nil
         out_lst lst_c)
) ;defun sub function: Plus list
;—————————————————————————–
(defun Sort (lst_d / flag_1 flag_2 num_1 num_2 l_s l_t temp c_1_1 c_1_2 c_1_3
                      c_1_4 c_1_5 c_1_6 c_2_1 c_2_2 c_2_3 c_2_4 c_2_5 c_2_6
                      lst_e lst_f out_lst)


 (setq num_1 (length lst_d)
       flag_1 T)
 (while flag_1
  (setq flag_2 T)
  (while flag_2
   (setq num_2 1
         l_s  (nth 0 lst_d)
         temp l_s)
   (repeat (- num_1 1)
    (setq l_t (nth num_2 lst_d)
          c_1_1 (substr (car l_s) 1 2)
          c_1_2 (substr (car l_s) 3 2)
          c_1_3 (substr (cadr l_s) 2 1)
          c_1_4 (substr (cadr l_s) 4 1)
          c_2_1 (substr (car l_t) 1 2)
          c_2_2 (substr (car l_t) 3 2)
          c_2_3 (substr (cadr l_t) 2 1)
          c_2_4 (substr (cadr l_t) 4 1)) ;setq
    (if (= (substr (cadr l_s) 8 1) “.”)
           (progn (setq c_1_5 (substr (cadr l_s) 7 1)
                        c_1_6 (substr (cadr l_s) 9 1)))
           (setq c_1_5 (substr (cadr l_s) 7 2))) ;if
    (if (= (substr (cadr l_t) 8 1) “.”)
           (progn (setq c_2_5 (substr (cadr l_t) 7 1)
                        c_2_6 (substr (cadr l_t) 9 1)))
           (setq c_2_5 (substr (cadr l_t) 7 2))) ;if
    (cond ((> c_1_1 c_2_1) (setq l_s l_t))
      ((= c_1_1 c_2_1)
        (cond ((> c_1_2 c_2_2) (setq l_s l_t))
          ((= c_1_2 c_2_2)
            (cond ((> c_1_3 c_2_3) (setq l_s l_t))
              ((= c_1_3 c_2_3)
                (cond ((> c_1_4 c_2_4) (setq l_s l_t))
                  ((= c_1_4 c_2_4)
                    (cond ((> c_1_5 c_2_5) (setq l_s l_t))
                      ((= c_1_5 c_2_5)
                         (if (> c_1_6 c_2_6) (setq l_s l_t)))))))))))) ;cond
    (setq num_2 (+ num_2 1))) ;repeat
    (if (= l_s temp)
        (progn (setq lst_e (cons l_s lst_e)
                     lst_d (cdr lst_d)
                     flag_2 nil
                     num_1 (- num_1 1)))
        (setq lst_d (reverse (cons temp (reverse (cdr lst_d)))))) ;if
  ) ;while
  (if (= num_1 1)
      (progn (setq flag_1 nil
                   lst_e (reverse (cons lst_d lst_e))))) ;if
 ) ;while
 (setq lst_f (car (car (reverse lst_e)))
       out_lst (reverse (cons lst_f (cdr (reverse lst_e))))) ;setq
) ;defun sub function: Sort list
;—————————————————————————–
(defun ChgPt (in_pt x y / outpt_x outpt_y out_pt)
  (setq outpt_x (+ (car in_pt) x)
        outpt_y (+ (cadr in_pt) y)
        out_pt nil
        out_pt (cons outpt_y out_pt)
        out_pt (cons outpt_x out_pt)) ;setq
) ;defun sub punction: Change point
;—————————————————————————–
(defun h_line (base_pt row_num / out_pt)
  (repeat row_num
          (command “line” base_pt “@110<0” “”)
          (setq base_pt (chgpt base_pt 0 -7))) ;repeat
  (setq base_pt (chgpt base_pt -20 0))
  (command “line” base_pt “@130<0” “”)
  (setq out_pt (chgpt base_pt 20 -7))
) ;defun sub function: draw horizontal line
;—————————————————————————–
(defun SubTotal (lst_g / subtt outtt)
  (setq subtt 0)
  (repeat (length lst_g)
          (setq subtt (+ subtt (last (car lst_g)))
                lst_g (cdr lst_g))) ;repeat
  (setq outtt subtt)
) ;defun sub function: calculating sub total
;—————————————————————————–
(defun WSheet (label pt_t lst_h ttotal / rec_1 tname tsize tqty)
  (command “text” pt_t “” “” label)
  (setq pt_t (chgpt pt_t 21 0))
  (repeat (length lst_h)
          (setq rec_1 (car lst_h)
                lst_h (cdr lst_h)
                tname (car rec_1)
                tsize (cadr rec_1)
                tqty (itoa (last rec_1))) ;setq
          (command “text” pt_t “” “”tname)
          (command “text” (chgpt pt_t 29 0) “” “” tsize)
          (if (= label “기 타”)
              (command “text” “c” (chgpt pt_t 67 0) “” “” “EA”)
              (command “text” “c” (chgpt pt_t 67 0) “” “” “EA”))
          (command “text” “r” (chgpt pt_t 89 0) “” “” tqty)
          (setq pt_t (chgpt pt_t 0 -7))) ;repeat
  (command “text” pt_t “” “” “소  계”)
  (if (= label “기 타”)
      (command “text” “c” (chgpt pt_t 67 0) “” “” “EA”)
      (command “text” “c” (chgpt pt_t 67 0) “” “” “EA”))
  (setq ttotal (itoa ttotal))
  (command “text” “r” (chgpt pt_t 89 0) “” “” ttotal)
) ;defun sub function: write sheet and sub total
;—————————————————————————–
(defun c:SISHEET (/ old_layer f_name fn_old var_fname sour_lst line_file tree_lst
                  flag one_line flag_item con_lst brleaf_lst shrub1_lst shrub2_lst
                  pt_o row_con row_brleaf row_shrub1 row_shrub2 row_total lawn
                  lawn_l ver_len move_pt next_pt text_pt subtt_1 subtt_2 subtt_3
                  subtt_4 tt_1 tt_2)


  (prompt “n작업중 잠시 기다리시요…”)
  (setvar “cmdecho” 0)
  (setvar “blipmode” 0)
  (setvar “filedia” 0)
  (setvar “osmode” 0)


; Define text style
  (if (= (tblsearch “style” “ghs”) nil)
      (command “style” “ghs” “romans,ghs” “” “” “” “” “” “”))
  (setvar “textstyle” “ghs”)
  (setvar “textsize” 3)


; Layer control
  (setq old_layer (getvar “clayer”))
  (if (= (tblsearch “layer” “sheet”) nil)
      (command “layer” “m” “sheet” “c” “2” “” “”)
      (if (/= old_layer “sheet”)
          (setvar “clayer” “sheet”)))


; Define out_put file name


  (setq f_name (strcat (getvar “dwgname”) “.TXT”))
  (if (findfile f_name)
      (progn (prompt “n집계표 작성을 의한 출력파일 “)
             (princ f_name)
             (setq fn_old f_name
                   f_name (getstring “와 같은 이름의  파일이 존재합니다. n새이름은?<Enter=겹침>: “))
             (if (= f_name “”) (setq f_name fn_old))))


; Out_put atribute list to file and make source list by read file
  (if (= (tblsearch “layer” “시설tag”) nil)
      (progn (prompt “n부여된 시설딱지가 없읍니다.”)
             (quit))) ;if
  (terpri)
  (command “attext” “s” “treetemp.txt” f_name)
  (if (= f_name nil) (quit))
  (setq var_fname  (open f_name “r”))
  (while (setq line_file (read-line var_fname))
         (setq sour_lst (cons line_file sour_lst))) ;while
  (close var_fname)
  (setq tree_lst sour_lst)


; Sort by tree form and add equal item
  (setq con_lst nil
        brleaf_lst nil
        shrub1_lst nil
        shrub2_lst nil
        herb_lst nil
        flag T)


  (while flag
         (setq one_line  (if (/= (car tree_lst) nil) (StrToLst (car tree_lst)))
               flag_item (car one_line)
               tree_lst  (cdr tree_lst)) ;setq
         (cond ((= flag_item nil) (setq flag nil))
               ((= flag_item 1)   (setq con_lst (cons (cdr one_line) con_lst)))
               ((= flag_item 2)   (setq brleaf_lst (cons (cdr one_line) brleaf_lst)))
               ((= flag_item 3)   (setq shrub1_lst (cons (cdr one_line) shrub1_lst)))
               ((= flag_item 4)   (setq shrub2_lst (cons (cdr one_line) shrub2_lst)))
               ((= flag_item 5)   (setq herb_lst (cons (cdr one_line) herb_lst))))) ; while


 (setq  con_lst    (pluslst con_lst)
        brleaf_lst (pluslst brleaf_lst)
        shrub1_lst (pluslst shrub1_lst)
        shrub2_lst (pluslst shrub2_lst)
        herb_lst   (pluslst herb_lst)) ;setq


; Make final list
  (if (/= con_lst nil)
      (if (= (length con_lst) 1)
          (setq con_lst con_lst)
          (setq con_lst (sort con_lst))))
  (if (/= brleaf_lst nil)
      (if (= (length brleaf_lst) 1)
          (setq brleaf_lst brleaf_lst)
          (setq brleaf_lst (sort brleaf_lst))))
  (if (/= shrub1_lst nil)
      (if (= (length shrub1_lst) 1)
          (setq shrub1_lst shrub1_lst)
          (setq shrub1_lst (sort shrub1_lst))))
  (if (/=  shrub2_lst nil)
      (if (= (length shrub2_lst) 1)
          (setq shrub2_lst shrub2_lst)
          (setq shrub2_lst (sort shrub2_lst))))
  (if (/=  herb_lst nil)
      (if (= (length herb_lst) 1)
          (setq herb_lst herb_lst)
          (setq herb_lst (sort herb_lst))))


; Drawing sheet table
  (initget 1)
    (princ “n >>>> —————————————————— <<<<  “)
    (princ “n >>>> 시작하기전에 이 명령은 페이퍼스페이스에서 실행할 것!!! <<<<  “)
    (princ “n >>>> —————————————————— <<<<  “)
  (setq pt_o       (getpoint “n표의 좌측상단점을 찍으시요: “)
        row_con    (length con_lst)
        row_brleaf (length brleaf_lst)
        row_shrub1 (length shrub1_lst)
        row_shrub2 (length shrub2_lst)
        row_herb   (length herb_lst)
        row_total  (+ row_con row_brleaf row_shrub1 row_shrub2 row_herb)) ;setq
  (initget 0)
  (setq flag T)
  (while flag


    (setq lawn (getint “n종료 하시겠어요 ?….n<0>필요없슴,: “))
    (if (and (>= lawn 0) (<= lawn 3))
        (progn (setq flag nil)
               (cond ((= lawn 0) (setq lawn_l 0))
                     ((= lawn 1) (setq lawn_l 1))
                     ((= lawn 2) (setq lawn_l 1))
                     ((= lawn 3) (setq lawn_l 2)))) ;cond,progn
        (Prompt “n잘못된 수치가 입력 되었슴 (가능수치: 0-3). 재입력 !”))) ;if,while
  (setq ver_len (* -1 (+ 10 (* 7 row_total) (if (/= lawn_l nil) (* 7 lawn_l)))))
  (if (/= row_con 0)    (setq ver_len (- ver_len 7)))
  (if (/= row_brleaf 0) (setq ver_len (- ver_len 7)))
  (if (/= row_shrub1 0) (setq ver_len (- ver_len 7)))
  (if (/= row_shrub2 0) (setq ver_len (- ver_len 7)))
  (if (/= row_herb 0)   (setq ver_len (- ver_len 7)))
  (if (or (/= row_con 0) (/= row_brleaf 0)) (setq ver_len (- ver_len 7)))
  (if (or (/= row_shrub1 0) (/= row_shrub2 0)) (setq ver_len (- ver_len 7)))
  (command “line” pt_o “@130<0” “”)
  (command “line” (chgpt pt_o 0 -9) “@130<0” “”)
  (command “line” (chgpt pt_o 0 -10) “@130<0” “”)
  (command “line” pt_o (chgpt pt_o 0 ver_len) “”)
  (command “line” (chgpt pt_o 20 0) (chgpt pt_o 20 ver_len) “”)
  (command “line” (chgpt pt_o 51 0) (chgpt pt_o 51 ver_len) “”)
  (command “line” (chgpt pt_o 85 0) (chgpt pt_o 85 ver_len) “”)
  (command “line” (chgpt pt_o 95 0) (chgpt pt_o 95 ver_len) “”)
  (command “line” (chgpt pt_o 115 0) (chgpt pt_o 115 ver_len) “”)
  (command “line” (chgpt pt_o 130 0) (chgpt pt_o 130 ver_len) “”)
  (command “text” “c” (chgpt pt_o 10 -7) “” “” “구 분”)
  (command “text” “c” (chgpt pt_o 35 -7) “” “” “시  설  명”)
  (command “text” “c” (chgpt pt_o 68 -7) “” “” “규  격”)
  (command “text” “c” (chgpt pt_o 90 -7) “” “” “단위”)
  (command “text” “c” (chgpt pt_o 105 -7) “” “” “시설수량”)
  (command “text” “c” (chgpt pt_o 123 -7) “” “” “비 고”)


  (setq text_pt (chgpt pt_o 2 -15.5)
        next_pt (chgpt text_pt 18 -1.5))
  (if (/= row_con 0)
      (progn (setq move_pt (chgpt pt_o 20 -17)
                   next_pt (h_line move_pt row_con)
                   subtt_1 (subtotal con_lst)) ;setq
             (wsheet ” 시설물” text_pt con_lst subtt_1)
             (setq text_pt (chgpt text_pt 0 (* (+ row_con 1) -7)))) ;progn
      (setq text_pt (chgpt pt_o 2 -15.5))) ;if
  (if (/= row_brleaf 0)
      (progn (setq move_pt next_pt
                   next_pt (h_line move_pt row_brleaf)
                   subtt_2 (subtotal brleaf_lst)) ;setq
             (wsheet ” 포 장” text_pt brleaf_lst subtt_2)
             (setq text_pt (chgpt text_pt 0 (* (+ row_brleaf 1) -7)))) ;progn
       (setq text_pt text_pt)) ;if
  (if (= subtt_1 nil) (setq subtt_1 0))
  (if (= subtt_2 nil) (setq subtt_2 0))
  (if (or (/= row_con 0) (/= row_brleaf 0))
      (progn (command “line” (chgpt next_pt -20 0) “@130<0” “”)
             (setq next_pt (chgpt next_pt 0 -7)
                   tt_1    (+ subtt_1 subtt_2))
             (command “text” text_pt “” “” ”  계”)
             (command “text” “c” (chgpt text_pt 88 0) “” “” “M2”)
             (command “text” “r” (chgpt text_pt 110 0) “” “” (itoa tt_1))
             (setq text_pt (chgpt text_pt 0 -7)))) ;progn,if
  (if (/= row_shrub1 0)
      (progn (setq move_pt next_pt
                   next_pt (h_line move_pt row_shrub1)
                   subtt_3 (subtotal shrub1_lst))
             (wsheet ” 포 장” text_pt shrub1_lst subtt_3)
             (setq text_pt (chgpt text_pt 0 (* (+ row_shrub1 1) -7))))) ;progn,if
  (if (/= row_shrub2 0)
      (progn (setq move_pt next_pt
                   next_pt (h_line move_pt row_shrub2)
                   subtt_4 (subtotal shrub2_lst))
             (wsheet ” 우배수” text_pt shrub2_lst subtt_4)
             (setq text_pt (chgpt text_pt 0 (* (+ row_shrub2 1) -7))))) ;if
  (if (= subtt_3 nil) (setq subtt_3 0))
  (if (= subtt_4 nil) (setq subtt_4 0))
  (if (or (/= row_shrub1 0) (/= row_shrub2 0))
      (progn (command “line” (chgpt next_pt -20 0) “@130<0” “”)
             (setq next_pt (chgpt next_pt 0 -7)
                   tt_2    (+ subtt_3 subtt_4))
             (command “text” text_pt “” “” “기타시설계”)
             (command “text” “c” (chgpt text_pt 88 0) “” “” “EA”)
             (command “text” “r” (chgpt text_pt 103 0) “” “” (itoa tt_2))
             (setq text_pt (chgpt text_pt 0 -7)))) ;progn,if
  (if (/= row_herb 0)
      (progn (setq move_pt next_pt
                   next_pt (h_line move_pt row_herb)
                   subtt_5 (subtotal herb_lst))
             (wsheet ” 기 타” text_pt herb_lst subtt_5)
             (setq text_pt (chgpt text_pt 0 (* (+ row_herb 1) -7))))) ;progn,if
  (if (/= lawn_l 0)
      (if (= lawn_l 2)
          (progn (command “line” next_pt “@110<0” “”)
                 (setq next_pt (chgpt next_pt -20 -7))
                 (command “line” next_pt “@100<0” “”)) ;progn
          (command “line” (chgpt next_pt -20 0) “@130<0” “”))) ;if,if
  (cond ((= lawn 1) (command “text” text_pt “” “” “모름”)
                    (command “text” (chgpt text_pt 21 0) “” “” “모름”)
                    (command “text” (chgpt text_pt 56.5 0) “” “” “0.3 x 0.3 x 0.03”)
                    (command “text” “c” (chgpt text_pt 49 0) “” “” “EA”)
                    (command “text” “r” (chgpt text_pt 131.5 0) “” “” “0”))
        ((= lawn 2) (command “text” text_pt “” “” “모름”)
                    (command “text” (chgpt text_pt 21 0) “” “” “모름”)
                    (command “text” (chgpt text_pt 56.5 0) “” “” “0.3 x 0.3 x 0.03”)
                    (command “text” “c” (chgpt text_pt 49 0) “” “” “EA”)
                    (command “text” “r” (chgpt text_pt 145.5 0) “” “” “0”))
        ((= lawn 3) (command “text” text_pt “” “” “모름”)
                    (command “text” (chgpt text_pt 21 0) “” “” “모름”)
                    (command “text” (chgpt text_pt 56.5 0) “” “” “0.3 x 0.3 x 0.03”)
                    (command “text” “c” (chgpt text_pt 49 0) “” “” “EA”)
                    (command “text” “r” (chgpt text_pt 145.5 0) “” “” “0”)
                    (setq text_pt (chgpt text_pt 0 -7))
                    (command “text” (chgpt text_pt 21 0) “” “” “모름”)
                    (command “text” (chgpt text_pt 56.5 0) “” “” “0.3 x 0.3 x 0.03”)
                    (command “text” “c” (chgpt text_pt 49 0) “” “” “EA”)
                    (command “text” “r” (chgpt text_pt 145.5 0) “” “” “0”))) ;cond
; Return system variables
  (if (/= old_layer “sheet”)
      (setvar “clayer” old_layer))
  (setvar “cmdecho” 1)
  (setvar “filedia” 1)
  (setvar “blipmode” 1)
  (princ)
)
;defun main function

  • 0
  • 13 조회
공유
  • Facebook

    관련 있는 질문들

    • FAQ 51을 참조 하라는데 FAQ가 어디에 있나요??
    • jsk.shx 파일 받을 부탁드립니다 ㅠ
    • 오토캐드 마지막 화면으로 실행 안됨
    • 오토캐드 마지막 화면으로 실행 안됨

    Sidebar

    질문하기
    공지사항

    • AI CAD의 미래! 캐디안 2025 1+1 프로모션 안내 2025-05-14

    Adv 234x60

    aalan

    Adv 234x60

    aalan

    Adv 120x600

    aalan

    Explore

    • 홈
    • 카테고리
      • AutoCAD & CADian
      • Inventor & Solidworks
      • Revit & ArchiCAD
      • 자유질문
      • 기타
    • 투표
    • 커뮤니티 그룹
    aalan

    Footer

    Support

    • 회사 및 서비스 소개
    • 자주 묻는 질문
    • 문의하기

    Guide

    • 제휴/협업 안내
    • 광고 서비스 안내

    Policy

    • 서비스 이용약관
    • 개인정보 처리방침
    • 광고성 정보 수신 동의

    Contents

    • 고밍스토리
    • 리습 시리즈

    정소프트 | 사업자등록번호 : 677-40-00198 | 대표 : 정은숙 | 이메일 : gocad.manager@gmail.com
    주소 : 서울특별시 강서구 양천로 400-12, 6층 614,615,617호(등촌동, 더리브골드타워)
    Copyright. 2012-2024 GOCAD All rights reserved