비밀번호를 잊으셨나요?

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

계정이 있나요? 로그인

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 108304
다음
진행 중
Lv.0
등록일: 2017-04-182017-04-18T12:23:42+09:00 2017-04-18T12:23:42+09:00카테고리: AutoCAD & CADian

파이 기호 리습 수정 문의 입니다.

숫자 앞에 %%c를 넣어 주는 리습인데 숫자 뒤에 %%d를 넣고 싶어요
수정 할 수 있게 도와주세요!
ex) 300-> %%c300 을 300%%d로 나타내고 싶어요



(defun C:ZC ( / TXT_String LOC ELIST EntType Old_TXT Chk_TXT EntType SUB Sub_Ent)
  (while (= TXT_String nil); checks to make sure something was selected
    (setq TXT_String (entsel “nPick the text to add Phi symbol :”); if nothing was selected try again
   Loc (cadr TXT_String); stores the point picked
   TXT_String (car TXT_String)); stores the entity name
    (if(= TXT_String nil)
      (princ “Nothing Picked”); tell user nothing has been selected
      ); end if
    ); end while
  (setq ELIST (entget TXT_String))
  (setq EntType (cdr (assoc 0 elist))); stores the entity type


  (cond


    ((= EntType “TEXT”)
     (setq Old_TXT (cdr (assoc 1 elist)); gets the text from the string
    Chk_TXT  (substr Old_TXT 1 3); gets the 1st 3 characters of the string for testing
     ); end setq
     (if
       (or (= Chk_TXT “%%c”) (= Chk_TXT “%%c”))
 (progn
   (setq New_Txt (substr Old_TXT 4); removes the Phi if it exists
  ELIST (subst (cons 1 New_TXT) (assoc 1 ELIST) ELIST); replaces the existing string
   ); end setq
 ); end progn
 (progn
   (setq New_TXT (strcat “%%c”Old_TXT); adds the Phi
  ELIST (subst (cons 1 New_TXT) (assoc 1 ELIST) ELIST);replaces the existing string
   ); end setq
 ); end Progn
     ); end if
    )


    ((= EntType “MTEXT”)
     (setq Old_TXT (cdr (assoc 1 elist))
    Chk_TXT  (substr Old_TXT 1 3); gets the 1st 3 characters of the string for testing
     ); end setq
     (if
       (= Chk_TXT “{%%c”)
 (progn
   (setq Strg_Lngh (- (strlen Old_TXT) 4); checks the string length – the Phi
  New_TXT   (substr Old_TXT 4 Strg_Lngh); removes the Phi if it exists
  ELIST   (subst (cons 1 New_TXT) (assoc 1 ELIST) ELIST); replaces the existing string
   ); end setq
 ); end progn
 (progn
   (setq New_TXT (strcat “{%%c”Old_TXT”}”);adds the Phi
  ELIST (subst (cons 1 New_TXT) (assoc 1 ELIST) ELIST);replaces the existing string
   ); end setq
 ); end Progn
     ); end if
    )


    ((= EntType “DIMENSION”)
     (setq Old_TXT (cdr (assoc 1 elist)); gets the text from the string
    Chk_TXT (substr Old_TXT 1 3); gets the 1st 3 characters of the string for testing
     );end setq
     (if
       (= Old_TXT “”)
 (setq Old_TXT “<>”)
     ); end if    
     (if
       (= Chk_TXT “{%%c”)
 (progn
   (setq Lngh (strlen old_txt)
  New_Lngh (- Lngh 4)
  New_TXT (substr Old_TXT 4 New_Lngh); removes the Phi if it exists
  ELIST (subst (cons 1 New_TXT) (assoc 1 ELIST) ELIST); replaces the existing string
   ); end setq
 ); end progn
 (progn
   (setq New_TXT (strcat “{%%c”Old_TXT”}”) ; adds the Phi
  ELIST (subst (cons 1 New_TXT) (assoc 1 ELIST) ELIST); replaces the existing string
   ); end setq
 ); end Progn
     ); end if
    )


    ((= EntType “INSERT”)
     (setq SUB    (nentselp LOC); Use pick point to select subentity
    Sub_Ent (car SUB); Store entity name
    Old_TXT (cdr (assoc 1 (entget Sub_Ent))); Retrieve value
    Chk_TXT  (substr Old_TXT 1 3); gets the 1st 3 characters of the string for testing
     ); end setq
     (if
       (or (= Chk_TXT “%%c”) (= Chk_TXT “%%c”))
 (progn
   (setq ELIST (entget Sub_Ent)
  New_Txt (substr Old_TXT 4)
  ELIST (subst (cons 1 New_TXT) (assoc 1 ELIST) ELIST)
   ); end setq
 ); end progn
 (progn
   (setq ELIST (entget Sub_Ent)
  New_TXT (strcat “%%c”Old_TXT)
  ELIST (subst (cons 1 New_TXT) (assoc 1 ELIST) ELIST)
   ); end setq
 ); end Progn
     ); end if
    )
    ((princ “nSelected object is not text”))
  ); end COND


  (entmod ELIST)
  (entupd TXT_String)
  (princ)
);end defun

  • 0
  • 1 1 답변
  • 19 조회
공유
  • Facebook

    관련 있는 질문들

    • mvsetup 및 align 안됨
    • mvsetup 및 align 안됨
    • 에어컨 실외기 도면
    • cad에서 기준점 복사 후 다른 파일에 붙여넣기 시 블록참조객체의 길이가 줄어들어있어요

    1 답변

    • 작성 순
    • 최신 순
    • 공감 순
    1. aalan
    2. [Deleted User]
      2017-04-18T16:59:29+09:00답변 등록 답변 등록 일시 2017-04-18 4:59 pm

      감사합니다 !! 즐거운 하루 되세요~

      • 0
      • 공유
        공유
        • 공유 Facebook
        • 공유 Twitter

    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