비밀번호를 잊으셨나요?

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

계정이 있나요? 로그인

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 177815
다음
답변됨
hongja
hongjaLv.0
등록일: 2022-11-222022-11-22T16:28:45+09:00 2022-11-22T16:28:45+09:00카테고리: AutoCAD & CADian

리습 단일 선택에서 다중 선택으로 바꾸고 싶습니다.

기존 텍스트에 특정 텍스를 기입하는 리습니다.
현제는 단일 선택으로 하나씩 눌려 변경하여야 하는데
여러개 객체를 한번에 선택 할수 있는 코드를 어디에서 바꿔야 할까요?

 
(defun C:PHT ( / 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 "'++") (= Chk_TXT "'++"))
(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 "'++"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 "{'++")
(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 "{'++"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 "{'++")
(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 "{'++"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 "'++") (= Chk_TXT "'++"))
(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 "'++"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
  • 3 3 답변
  • 66 조회
공유
  • Facebook

    관련 있는 질문들

    • 캐드에서 복사해서 방향 옮길때 다른방향으로 가요.
    • 캐드에서 복사해서 방향 옮길때 다른방향으로 가요.
    • FAQ 51을 참조 하라는데 FAQ가 어디에 있나요??
    • jsk.shx 파일 받을 부탁드립니다 ㅠ

    답변을 남겨주세요
    응답 취소

    답변을 등록하기 위해서는 로그인이 필요합니다.

    비밀번호를 잊으셨나요?

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

    3 답변

    • 작성 순
    • 최신 순
    • 공감 순
    1. aalan
    2. 베스트 답변
      수야12 Lv.21
      2022-11-22T18:07:56+09:00답변 등록 답변 등록 일시 2022-11-22 6:07 pm
      (수정됨)

      코드를 올리실 경우 공지 사항 한번 읽어 보시고 올리세요

      이 리습은 전체를 새로운 구문으로 둘러야 합니다 그런데 이런식으로 코드를 게시하면 수정 하시는 분이 이거 드래그 해서 노가다 해야 합니다.

      • 0
      • 댓글 달기
      • 공유
        공유
        • 공유 Facebook
        • 공유 Twitter
      • hongja Lv.0
        2022-11-24T16:01:31+09:00에게 댓글을 달았습니다. 답변 등록 일시 2022-11-24 4:01 pm

        잘못된 양식의 글을 올려 죄송합니다
        사이트 오른쪽에 보이는 공지사항에는 코드 관련 공지가 안 보이는데
        어디서 볼 수 있는지 알 수 있을까요?

        단순 변경 일줄 알았는데 그렇지 않은가 보네요

        • 0
        • 댓글 달기
        • 공유
          공유
          • 공유 Facebook
          • 공유 Twitter
        • 수야12 Lv.21
          2022-11-24T21:09:40+09:00에게 댓글을 달았습니다. 답변 등록 일시 2022-11-24 9:09 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

    링크 삽입/편집

    대상 URL을 입력하세요

    또는 기존의 콘텐츠에 링크

      검색어가 지정되지 않았습니다. 최근 항목 표시 검색하거나 위와 아래 화살키를 이용하여 항목을 선택하세요.