비밀번호를 잊으셨나요?

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

계정이 있나요? 로그인

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 97306
다음
kksjj750
kksjj750Lv.0
등록일: 2013-02-072013-02-07T18:33:46+09:00 2013-02-07T18:33:46+09:00카테고리: AutoCAD & CADian

사칙연산 리습 수정 부탁합니다.

항상 고캐드에서 도움을 받고 있습니다.
잘 쓰고 있는 리습인데요 콤마나 점이 있으면 계산이 안됩니다.
콤마나 점이 있어도 계산 가능하게 부탁드립니다.

(defun exe1()
   (setvar “cmdecho” 0)
   (setvar “blipmode” 0)
   (setq cl (getvar “clayer”))
   (setq e1 (entsel “n>>첫번째숫자선택:”))
   (setq a (car e1);;———-엔티티의 이름값
         b (entget a);;——–엔티티의 리스트값
         txt1 (assoc 1 b);;—-엔티티중 해당 문자열 리스트
         tt1 (cdr txt1);;——엔티티 문자열의 리스트중 뒤의값=”문자열”
         sum1 (atof tt1);;—–엔티티의 문자열을 정수로 변환=100
         txth1 (assoc 40 b);;–엔티티 리스트중 텍스트 높이의 리스트값(40,100)
         thh (cdr txth1);;—–엔티티의 텍스트높이의 리스트중 뒤의값=100
   )         
   (setq e2 (entsel “n>>두번째숫자선택:”))
   (setq aa (car e2)
         bb (entget aa)
         txt2 (assoc 1 bb)
         tt2 (cdr txt2)
         sum2 (atof tt2)
         )
    (setq tl (assoc 8 b)
          txtst (cdr tl)
    )
)
 (defun exe+()
    (setq sum (+ sum1 sum2))
    (setq summ (rtos sum 2 3))
    (setq p1 (getpoint “n>>표시할 포인트찍기:”))
    (command “layer” “s” “tex” “” “”)
    (command “text” p1 thh 0 summ)
    (command “layer” “s” cl “”)  
 )
 (defun exe-()
    (setq sum (- sum1 sum2))
    (setq summ (rtos sum 2 3))
    (setq p1 (getpoint “n>>표시할 포인트찍기:”))
    (command “layer” “s” “tex” “” “”)
    (command “text” p1 thh 0 summ)
    (command “layer” “s” cl “”)  
 )
 (defun exe*()
    (setq sum (* sum1 sum2))
    (setq summ (rtos sum 2 3))
    (setq p1 (getpoint “n>>표시할 포인트찍기:”))
    (command “layer” “s” “tex” “” “”)
    (command “text” p1 thh 0 summ)
    (command “layer” “s” cl “”)  
 )
 (defun exe/()
    (setq sum (/ sum1 sum2))
    (setq summ (rtos sum 2 3))
    (setq p1 (getpoint “n>>표시할 포인트찍기:”))
    (command “layer” “s” “tex” “” “”)
    (command “text” p1 thh 0 summ)
    (command “layer” “s” cl “”)  
 )
 (defun exe%()
    (setq sum (* (/ sum1 sum2) 100))
    (setq summ (rtos sum 2 3))
    (setq p1 (getpoint “n>>표시할 포인트찍기:”))
    (command “layer” “s” “tex” “” “”)
    (command “text” p1 thh 0 summ)
    (command “layer” “s” cl “”)  
 )
(defun c:+( / cl e1 a b txt1 tt1 sum1 txth1 thh e2 aa bb txt2 tt2 sum2 tl txtst sum summ p1)
  (exe1)
  (exe+)
  (princ)
)
(defun c:-( / cl e1 a b txt1 tt1 sum1 txth1 thh e2 aa bb txt2 tt2 sum2 tl txtst sum summ p1)
   (exe1)
   (exe-)
   (princ)
)
(defun c:*( / cl e1 a b txt1 tt1 sum1 txth1 thh e2 aa bb txt2 tt2 sum2 tl txtst sum summ p1)
   (exe1)
   (exe*)
   (princ)
)
(defun c:/( / cl e1 a b txt1 tt1 sum1 txth1 thh e2 aa bb txt2 tt2 sum2 tl txtst sum summ p1)
  (exe1)
  (exe/)
  (princ)
)
(defun c:%( / cl e1 a b txt1 tt1 sum1 txth1 thh e2 aa bb txt2 tt2 sum2 tl txtst sum summ p1)
  (exe1)
  (exe%)
  (princ)
)
;;(defun c:py( / cl e1 a b txt1 tt1 sum1 txth1 thh sum summ p1 )
;;   (setvar “cmdecho” 0)
;;   (setvar “blipmode” 0)
;;   (setq cl (getvar “clayer”))
;;   (setq e1 (entsel “n>>숫자선택:”))
;;   (setq a (car e1);;———-엔티티의 이름값
;;         b (entget a);;——–엔티티의 리스트값
;;         txt1 (assoc 1 b);;—-엔티티중 해당 문자열 리스트
;;         tt1 (cdr txt1);;——엔티티 문자열의 리스트중 뒤의값=”문자열”
;;         sum1 (atof tt1);;—–엔티티의 문자열을 정수로 변환=100
;;         txth1 (assoc 40 b);;–엔티티 리스트중 텍스트 높이의 리스트값(40,100)
;;         thh (cdr txth1);;—–엔티티의 텍스트높이의 리스트중 뒤의값=100
;;   )
;;    (setq sum (/ sum1 3.3058))
;;    (setq summ (rtos sum 2 3))
;;    (setq zz (strcat “(” summ “)”))
;;    (setq p1 (getpoint “n>>표시할 포인트찍기:”))
;;    (command “layer” “s” “tex” “” “”)
;;    (command “text” p1 thh 0 zz)
;;    (command “layer” “s” cl “”)  
;;(princ)
;;)
(defun c:++( / cl sum_m ss ok e ent sum_ p1 txth1 thh summ )
 (setvar “cmdecho” 0)
 (setvar “blipmode” 0)
 (setq cl (getvar “clayer”))
 (setq sum_m 0)
  (setq SS (ssget))
  (setq ok 0)
  (while
    (setq e (ssname ss ok))
    (setq ent (entget e))
    (setq sum_ (assoc 1 ent))
    (setq sum_ (cdr sum_))
    (setq sum_ (atof sum_))
    (setq sum_m (+ sum_m sum_))
    (setq ok (1+ ok))
  )
 (setq p1 (getpoint “n>>표시할 포인트찍기:”))
    (command “layer” “s” “tex” “” “”)
    (setq txth1 (assoc 40 ent))
    (setq thh (cdr txth1))
    (setq summ (rtos sum_m 2 3))
    (command “text” p1 thh 0 summ)
    (command “layer” “s” cl “”)   
(princ)      
)
(defun c:**( / cl sum_m ss ok e ent sum_ p1 txth1 thh summ )
 (setvar “cmdecho” 0)
 (setvar “blipmode” 0)
 (setq cl (getvar “clayer”))
 (setq sum_m 1)
  (setq SS (ssget))
  (setq ok 0)
  (while
    (setq e (ssname ss ok))
    (setq ent (entget e))
    (setq sum_ (assoc 1 ent))
    (setq sum_ (cdr sum_))
    (setq sum_ (atof sum_))
    (setq sum_m (* sum_m sum_))
    (setq ok (1+ ok))
  )
 (setq p1 (getpoint “n>>표시할 포인트찍기:”))
    (command “layer” “s” “tex” “” “”)
    (setq txth1 (assoc 40 ent))
    (setq thh (cdr txth1))
   (setq summ (rtos sum_m 2 3))
    (command “text” p1 thh 0 summ)
    (command “layer” “s” cl “”)   
(princ)      
)
(princ “n>>사칙연산 프로그램 로딩완료 command : +,-,*,/,%,py,++,**”)
(princ)

  • 0
  • 19 조회
공유
  • Facebook

    관련 있는 질문들

    • 오토캐드 2016 맞춤법 검사기 끄는 방법 아시나요
    • 캐드에서 여러도면을 한번에 배치출력 할 수 있는 방법이 있나요
    • step파일, iges 파일을 열어서 볼 수 있는 방법이 있을까요?
    • 캐디안으로 도면을 열때 한글이 ???로 표시되는 문제

    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