비밀번호를 잊으셨나요?

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

계정이 있나요? 로그인

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 87909
다음
리루스
리루스Lv.0
등록일: 2010-06-302010-06-30T15:35:07+09:00 2010-06-30T15:35:07+09:00카테고리: AutoCAD & CADian

일률적으로 주어진 값에 +,-,/,x 하는 리습입니다. 09버전 캐드에서 오류가 나요.

(defun c:nu( / dcl_id start_lisp start_dcl lbox_inint total_inint un_to_kht to_kht ;–main
  num_chk do_t ebox_t_nil       bt_un_1_0   bt_tt_1_0 a_ex a_app dim_zin)
(defun start_lisp( / n )
 (setq n 0 a_ex (ssget ‘((0 . “text”))) a (ssadd) )
 (if a_ex
  (repeat (sslength a_ex)
    (setq str (cdr (assoc 1 (entget (ssname a_ex n)))) )
    (if (num_chk str) (ssadd (ssname a_ex n) a) )
    (setq n (1+ n))
  )
  (progn (alert “선택된 텍스트가 없습니다.”) (exit) )
 )
 (if (= (sslength a) 0) (progn (alert “숫자로된 택스트가 없습니다.”)(exit)) )
)
(defun start_dcl ()
  (if (not bt_un_1_0) (setq bt_un_1_0 “button+”) )
  (if (not bt_tt_1_0) (setq bt_tt_1_0 “button1”) )
  (set_tile bt_un_1_0 “1”)
  (set_tile bt_tt_1_0 “1”)
  (set_tile “ebox” “1”)
  (total_inint)
  (setq a_app (list) n 0)
  (repeat (sslength a)
   (setq a_app (append a_app (list (cdr (assoc 1 (entget (ssname a n)))))) n (1+ n) )
  )
  (lbox_inint “lbox1” a_app) 
  (un_to_kht)
  (set_tile “lbox1” “0”)
  (set_tile “lbox2” “0”)
)  


(defun lbox_inint (a b)
  (start_list a) (mapcar ‘add_list b) (end_list)
)
(defun total_inint ()
  (cond
    ((= bt_un_1_0 “button+”) (setq to_ex “+”))
    ((= bt_un_1_0 “button-“) (setq to_ex “–“))
    ((= bt_un_1_0 “button/”) (setq to_ex “/”))
    ((= bt_un_1_0 “button*”) (setq to_ex “X”))
  )
  (set_tile “total” to_ex)
 )
(defun un_to_kht ()
  (setq end_app (list) n 0)
  (repeat (length a_app)
  
   (setq end_app (append end_app (list (to_kht (nth n a_app)) )))
   (setq n (1+ n))
  )
  (lbox_inint “lbox2” end_app)
  (set_tile “lbox2” (get_tile “lbox1”))
)



(defun to_kht (a)
  (setq ex a)
  (cond
    ((= bt_un_1_0 “button+”) (setq b ‘+))
    ((= bt_un_1_0 “button-“) (setq b ‘-))
    ((= bt_un_1_0 “button/”) (setq b ‘/))
    ((= bt_un_1_0 “button*”) (setq b ‘*))
  )
  (cond
    ((= bt_tt_1_0 “button0”) (setq c ‘0))
    ((= bt_tt_1_0 “button1”) (setq c ‘1))
    ((= bt_tt_1_0 “button2”) (setq c ‘2))
    ((= bt_tt_1_0 “button3”) (setq c ‘3))
    ((= bt_tt_1_0 “button4”) (setq c ‘4))
    ((= bt_tt_1_0 “button5”) (setq c ‘5))
  )
  (eval ‘(rtos ((eval b) (atof a) (atof (get_tile “ebox”))) 2 c) )
)
(defun ebox_t_nil ()
 (if (not (num_chk (get_tile “ebox”)) ) (alert (strcat “””(get_tile “ebox”)””” ”  은 올바른 숫자가 아님니다.nn 다시 입력하세요.”)) )
 (num_chk (get_tile “ebox”))
)
(defun num_chk(a / t_nil na b)
    (setq t_nil t na 1)
    (repeat (strlen a)
      (setq b (substr a na 1) na (1+ na) )
      (if (not (or (= b “1”)(= b “2”)(= b “3”)(= b “4”)(= b “5”)(= b “6”)(= b “7”)(= b “8”)(= b “9”)
          (= b “0”)(= b “.”)(= b “-“)) )
          (setq t_nil nil)
      )
    )
    t_nil
)
(defun do_t( / n)
 (setq n 0)
 (repeat (sslength a)
  (entmod (subst (cons 1 (nth n end_app)) (assoc 1 (entget (ssname a n))) (entget (ssname a n)) ))
  (setq n (1+ n))
 )
)


 ;(bgnerr)
 (start_lisp)
 (setq dcl_id (load_dialog “k_tnum”))
 (new_dialog “union” dcl_id)
 (start_dcl)
 (setq dim_zin (getvar “dimzin”))
 (setvar “dimzin” 1)
 (action_tile “accept” “(if (ebox_t_nil) (progn (un_to_kht)(done_dialog 2)) )”)                                     ;lbox3제거
 (action_tile “cancel” “(done_dialog 1)”)  
 (action_tile “button+” “(if (ebox_t_nil) (progn (setq bt_un_1_0 ”button+”) (un_to_kht)(total_inint)) (set_tile bt_un_1_0 ”1”) )”)
 (action_tile “button-” “(if (ebox_t_nil) (progn (setq bt_un_1_0 ”button-”) (un_to_kht)(total_inint)) (set_tile bt_un_1_0 ”1”) )”)
 (action_tile “button/” “(if (ebox_t_nil) (progn (setq bt_un_1_0 ”button/”) (un_to_kht)(total_inint)) (set_tile bt_un_1_0 ”1”) )”)
 (action_tile “button*” “(if (ebox_t_nil) (progn (setq bt_un_1_0 ”button*”) (un_to_kht)(total_inint)) (set_tile bt_un_1_0 ”1”) )”)
 (action_tile “button0” “(if (ebox_t_nil) (progn (setq bt_tt_1_0 ”button0”) (un_to_kht)) (set_tile bt_tt_1_0 ”1”) )”)
 (action_tile “button1” “(if (ebox_t_nil) (progn (setq bt_tt_1_0 ”button1”) (un_to_kht)) (set_tile bt_tt_1_0 ”1”) )”)
 (action_tile “button2” “(if (ebox_t_nil) (progn (setq bt_tt_1_0 ”button2”) (un_to_kht)) (set_tile bt_tt_1_0 ”1”) )”)
 (action_tile “button3” “(if (ebox_t_nil) (progn (setq bt_tt_1_0 ”button3”) (un_to_kht)) (set_tile bt_tt_1_0 ”1”) )”)
 (action_tile “button4” “(if (ebox_t_nil) (progn (setq bt_tt_1_0 ”button4”) (un_to_kht)) (set_tile bt_tt_1_0 ”1”) )”)
 (action_tile “button5” “(if (ebox_t_nil) (progn (setq bt_tt_1_0 ”button5”) (un_to_kht)) (set_tile bt_tt_1_0 ”1”) )”)
 (action_tile “bt1” “(if (ebox_t_nil) (un_to_kht))”)
 (action_tile “lbox1” “(set_tile ”lbox2” (get_tile ”lbox1”))”)
 (action_tile “lbox2” “(set_tile ”lbox1” (get_tile ”lbox2”))”)
 (setq ok (start_dialog))
 (unload_dialog dcl_id)
 (if (= ok 2) (do_t))
 (setvar “dimzin” dim_zin)
 ;(enderr)
 (princ)
)


(princ “n tnum 이 로드됬습니다.n일률적으로 주어진 값에 +,-,/,x 하는 리습입니다. “)
(princ)


 



어디가 잘 못된건가요??
제가 만든건 아니지만 09버전에서 자꾸 오류가 나네요.

  • 0
  • 5 조회
공유
  • Facebook

    관련 있는 질문들

    • 동적블록 신축에서 길이를 늘릴때 최종 길이를 입력 또는 늘려야 하는 차이만큼의 길이를 입력
    • 캐드 타일 개수 구하기
    • 캐드 선택할 때 마우스 옆에 박스안 초록동그라미, 파란동그라미 표시 어떻게 없애나요?
    • 캐드 용량이 16.8MB 인데 10MB 이하로 줄이고 싶습니다

    Sidebar

    질문하기
    공지사항

    • 국산 CAD ‘캐디안 2025’ 출시 사전 예약 진행 2024-09-27

    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