비밀번호를 잊으셨나요?

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

계정이 있나요? 로그인

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 191147
다음
진행 중
삽이
삽이Lv.0
등록일: 2024-09-212024-09-21T15:37:49+09:00 2024-09-21T15:37:49+09:00카테고리: 기타

X Z 좌표리습 수정좀 도와주세요

X Z 좌표리습 수정좀 도와주세요

X,Y좌표리습을 선배님들 도움으로 X,Z로 바꿔서 사용중인데요.

(X=Z , Y=X (X좌표는 x2로 출력))

((((좌표 마지막이 정수로 떨어질 시 숫자 뒤에 (.)이 찍히도록 사용중인데,))))

정수 마지막 숫자가

짝수로 떨어지면 (.)이 찍히는데

홀수로 떨어지면 (.)이 안찍히네요.

EX)  X1988.    (끝자리 숫자가 8(짝수)라서 숫자 마지막에 . 찍힘)

X1987    (끝자리 숫자가 7(홀수)라서 숫자 마지막에 . 안찍힘)

위의 설명과 같은 내용이 포함된 이미지 첨부했습니다. 하단에 프로그램도 첨부합니다.

원 제작자분께 감사드리며, 도움 부탁드립니다

—출처—

Created by Trusted

Naver Blog : https://blog.naver.com/trusted_dwg

——————————————————————————————————————-

(defun c:ZX( / makeLayer maketextstyle searchmleaderstyle makemleaderstyle oldlayer oldcmleaderstyle pt1 pt2 xcoordinate ycoordinate allcoordinate)

(vl-load-com)

(defun makeLayer (newlayername newlayerColor)

(entmake

(list

(cons 0 “LAYER”)

(cons 100 “AcDbSymbolTableRecord”)

(cons 100 “AcDbLayerTableRecord”)

(cons 2 newlayername) ;layer name

(cons 70 0)

(cons 62 newlayerColor) ;layer color

)

)

)

(defun maketextstyle (newstylename)

(entmake

(list

(cons 0 “style”)

(cons 100 “AcDbSymbolTableRecord”)

(cons 100 “AcDbTextStyleTableRecord”)

(cons 2 newstylename) ;style name

(cons 3 “arial.ttf”) ;font

;(cons 4 “whgtxt.shx”) ;bigfont

(cons 70 0)

(cons 40 0) ;fixed height / 0=non

(cons 41 1) ;width factor

(cons 50 0) ;oblique angle

(cons 71 0) ;2=mirrored in X / 4=mirrored in Y

)

)

)

(defun searchmleaderstyle (mleaderstylename / mleaderstyledict searchresult)

(if

(setq mleaderstyledict (dictsearch (namedobjdict) “acad_mleaderstyle”))

(foreach x mleaderstyledict

(if

(and

(= (car x) 3)

(eq (strcase (cdr x)) (strcase mleaderstylename))

)

(setq searchresult t)

)

)

)

searchresult

)

(defun makemleaderstyle (newmleadername newmleadertextstyle)

(setq mleaderstyles (vla-item (vla-get-Dictionaries (vla-get-ActiveDocument (vlax-get-acad-object))) “ACAD_MLEADERSTYLE”))

(setq newmleaderstyle (vla-AddObject mleaderstyles newmleadername “AcDbMLeaderStyle”))

(vla-put-TextStyle newmleaderstyle newmleadertextstyle)

(vla-put-TextAngleType newmleaderstyle “1”)

(vla-put-ArrowSize newmleaderstyle “100”)

(vla-put-DoglegLength newmleaderstyle “100”)

(vla-put-TextHeight newmleaderstyle “100”)

(vla-put-TextLeftAttachmentType newmleaderstyle “3”)

(vla-put-TextRightAttachmentType newmleaderstyle “3”)

)

(if

(= (tblsearch “style” “xycoordinates”) nil)

(maketextstyle “xycoordinates”)

(princ)

)

(setq oldlayer (getvar “clayer”))

(if

(= (tblsearch “layer” “xycoordinates”) nil)

(progn

(makelayer “xycoordinates” 1)

(setvar “clayer” “xycoordinates”)

)

(setvar “clayer” “xycoordinates”)

)

(setq oldcmleaderstyle (getvar “cmleaderstyle”))

(if

(= (searchmleaderstyle “xycoordinates”) nil)

(progn

(makemleaderstyle “xycoordinates” “xycoordinates”)

(setvar “cmleaderstyle” “xycoordinates”)

)

(setvar “cmleaderstyle” “xycoordinates”)

)

(setq pt1 (getpoint “nClick point to measure”))

(if pt1

(progn

(if (not (vl-string-search “.” (rtos (car pt1) 2 3))) ;Z좌표

(setq xcoordinate (strcat “Z” (rtos (car pt1) 2 3) “.”))

(setq xcoordinate (strcat “Z” (rtos (car pt1) 2 3)))

)

(if (not (vl-string-search “.” (rtos (cadr pt1) 2 3))) ;X좌표(지름값-좌표*2)

(setq ycoordinate (strcat “X” (rtos (*(cadr pt1)2) 2 3) “.”))

(setq ycoordinate (strcat “X” (rtos (*(cadr pt1)2) 2 3)))

)

(setq allcoordinate (strcat Ycoordinate “n” Xcoordinate))

(command “mleader” pt1 pause allcoordinate)

)

)

(setvar “clayer” oldlayer)

(setvar “cmleaderstyle” oldcmleaderstyle)

(princ)

)

(defun c:ZXC( / makeLayer maketextstyle searchmleaderstyle makemleaderstyle newvalue mleaderstyles newmleaderstyle)

(vl-load-com)

(defun makeLayer (newlayername newlayerColor)

(entmake

(list

(cons 0 “LAYER”)

(cons 100 “AcDbSymbolTableRecord”)

(cons 100 “AcDbLayerTableRecord”)

(cons 2 newlayername) ;layer name

(cons 70 0)

(cons 62 newlayerColor) ;layer color

)

)

)

(defun maketextstyle (newstylename)

(entmake

(list

(cons 0 “style”)

(cons 100 “AcDbSymbolTableRecord”)

(cons 100 “AcDbTextStyleTableRecord”)

(cons 2 newstylename) ;style name

(cons 3 “arial.ttf”) ;font

;(cons 4 “whgtxt.shx”) ;bigfont

(cons 70 0)

(cons 40 0) ;fixed height / 0=non

(cons 41 1) ;width factor

(cons 50 0) ;oblique angle

(cons 71 0) ;2=mirrored in X / 4=mirrored in Y

)

)

)

(defun searchmleaderstyle (mleaderstylename / mleaderstyledict searchresult)

(if

(setq mleaderstyledict (dictsearch (namedobjdict) “acad_mleaderstyle”))

(foreach x mleaderstyledict

(if

(and

(= (car x) 3)

(eq (strcase (cdr x)) (strcase mleaderstylename))

)

(setq searchresult t)

)

)

)

searchresult

)

(defun makemleaderstyle (newmleadername newmleadertextstyle)

(setq mleaderstyles (vla-item (vla-get-Dictionaries (vla-get-ActiveDocument (vlax-get-acad-object))) “ACAD_MLEADERSTYLE”))

(setq newmleaderstyle (vla-AddObject mleaderstyles newmleadername “AcDbMLeaderStyle”))

(vla-put-TextStyle newmleaderstyle newmleadertextstyle)

(vla-put-TextAngleType newmleaderstyle “1”)

(vla-put-ArrowSize newmleaderstyle “100”)

(vla-put-DoglegLength newmleaderstyle “100”)

(vla-put-TextHeight newmleaderstyle “100”)

(vla-put-TextLeftAttachmentType newmleaderstyle “3”)

(vla-put-TextRightAttachmentType newmleaderstyle “3”)

)

(setq newvalue (getreal “n input new size for text and arrow “))

(setq mleaderstyles (vla-item (vla-get-Dictionaries (vla-get-ActiveDocument (vlax-get-acad-object))) “ACAD_MLEADERSTYLE”))

(setq newmleaderstyle (vla-AddObject mleaderstyles “xycoordinates” “AcDbMLeaderStyle”))

(if

(= newvalue nil)

(princ “ndo not leave new size empty!!!”)

(progn

(if

(= (searchmleaderstyle “xycoordinates”) nil)

(progn

(if

(= (tblsearch “style” “xycoordinates”) nil)

(maketextstyle “xycoordinates”)

)

(if

(= (tblsearch “layer” “xycoordinates”) nil)

(makelayer “xycoordinates” 1)

)

(if

(= (searchmleaderstyle “xycoordinates”) nil)

(makemleaderstyle “xycoordinates” “xycoordinates”)

)

(vla-put-ArrowSize newmleaderstyle newvalue)

(vla-put-DoglegLength newmleaderstyle newvalue)

(vla-put-TextHeight newmleaderstyle newvalue)

)

(progn

(vla-put-ArrowSize newmleaderstyle newvalue)

(vla-put-DoglegLength newmleaderstyle newvalue)

(vla-put-TextHeight newmleaderstyle newvalue)

)

)

)

)

(princ)

)

(princ “nCreated by Trusted_dwg”)

(princ “nWrite coordinate with MLEADER. Command : XY, XYT”)

(princ “nNaver Blog : https://blog.naver.com/trusted_dwg”)

(princ “nYoutube : https://www.youtube.com/trusted_dwg”)

(princ)

  • 1
  • 1 1 답변
  • 308 조회
공유
  • Facebook

    관련 있는 질문들

    • 채용안내
    • CAD_CONNECT_EXCEL 리습 회사에서 사용 해도 문제 없나요?
    • 3d 폴리라인 점에 부여되어있는 Z값을 텍스트로 나타내는법
    • cadplus_plot 알람창 질문

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

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

    비밀번호를 잊으셨나요?

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

    1 답변

    • 작성 순
    • 최신 순
    • 공감 순
    1. aalan
    2. 주왕 Lv.25
      2024-09-24T08:08:12+09:00답변 등록 답변 등록 일시 2024-09-24 8:08 am

      (setq ycoordinate (strcat “X” (rtos (*(cadr pt1)2) 2 3) “.”))
      (setq ycoordinate (strcat “X” (rtos (*(cadr pt1)2) 2 3)))
      위부분 아래껄로 바꿔서 해보세요………
      (setq ycoordinate (strcat “X” (rtos (cadr pt1) 2 3) “.”))
      (setq ycoordinate (strcat “X” (rtos (cadr pt1) 2 3)))

      • 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을 입력하세요

    또는 기존의 콘텐츠에 링크

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