비밀번호를 잊으셨나요?

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

계정이 있나요? 로그인

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 194579
다음
곰메리
곰메리Lv.0
등록일: 2025-04-112025-04-11T14:03:55+09:00 2025-04-11T14:03:55+09:00카테고리: AutoCAD & CADian

기울어진 텍스트 테두리 생성 LISP ??

기울어진 텍스트 테두리 생성 LISP ??

안녕하세요 선배님들
리습 사용중에 도움이 필요해서 질문글을 올립니다

배관 도면을 그리면서 텍스트를 사용하다 보니 주변에 테두리를 넣어야 할 때가 있습니다
관련 LISP 검색을 하던중 BT 명령어로 시작하는 테두리 생성 LISP을 찾았는데..

이게 정방향으로 있는 텍스트들은 잘 되는데 등각평면도(ISO)에 넣는 텍스트는 다른 방향으로 나오더라구요
첨부된 사진 파일 보시면 X로 표시된게 LISP 출력되어 나오는거고 O로 표시된게 제가 의도하는 모양입니다

이런게 출력되게끔 하려면 어떻게 수정 해야 할까요?

;;—————————-=={ Box Text }==————————–;;
;; ;;
;; This program performs in much the same way as the Express Tools’ ;;
;; ‘TCircle’ command: enabling the user to create a 2D polyline ;;
;; rectangular frame around selected Text & MText objects, with a ;;
;; user-defined offset. ;;
;; ;;
;; Upon issuing the command syntax ‘BT’ at the AutoCAD command-line, ;;
;; the program first prompts the user to specify an offset factor ;;
;; for the text frame. This factor is multiplied by the text height ;;
;; for every selected text object to determine the offset of the ;;
;; rectangular frame from the text. At this prompt, the last used ;;
;; value is available as a default option. ;;
;; ;;
;; The program then prompts the user to make a selection of text ;;
;; and/or mtext objects. Following a valid selection, the program ;;
;; iterates over the selection and constructs a rectangular frame ;;
;; surrounding each object, offset by a distance determined by the ;;
;; given offset factor. The generated text box will inherit the ;;
;; basic properties of the enclosed text object (e.g. Layer, Linetype, ;;
;; Lineweight etc.). ;;
;; ;;
;; The program will also perform successfully with Text or MText ;;
;; defined in any construction plane, and under all UCS & view ;;
;; settings. ;;
;;———————————————————————-;;
;; Author: Lee Mac, Copyright ?2010 – http://www.lee-mac.com ;;
;;———————————————————————-;;
;; Version 1.2 – 2015-02-22 ;;
;;———————————————————————-;;

(defun c:bt ( / *error* def enx idx lst off sel )

(defun *error* ( msg )
(LM:endundo (LM:acdoc))
(if (not (wcmatch (strcase msg t) “*break,*cancel*,*exit*”))
(princ (strcat “nError: ” msg))
)
(princ)
)

(if (or (not (setq def (getenv “LMac\boxtext-off”)))
(not (setq def (distof def 2)))
)
(setenv “LMac\boxtext-off” (rtos (setq def 0.35) 2 2))
)
(initget 4)
(if (setq off (getreal (strcat “nSpecify offset factor : “)))
(setenv “LMac\boxtext-off” (rtos off 2 2))
(setq off def)
)

(LM:startundo (LM:acdoc))
(if (setq sel (LM:ssget “nSelect text or mtext : ” ‘(((0 . “TEXT,MTEXT”)))))
(repeat (setq idx (sslength sel))
(setq enx (entget (ssname sel (setq idx (1- idx))))
lst (text-box-off enx (* off (cdr (assoc 40 enx))))
)
(entmake
(append
‘(
(000 . “LWPOLYLINE”)
(100 . “AcDbEntity”)
(100 . “AcDbPolyline”)
(090 . 4)
(070 . 1)
)
(LM:defaultprops enx)
(list (cons 038 (caddar lst)))
(mapcar ‘(lambda ( x ) (cons 10 x)) lst)
(list (assoc 210 enx))
)
)
)
)
(LM:endundo (LM:acdoc))
(princ)
)

;; ssget – Lee Mac
;; A wrapper for the ssget function to permit the use of a custom selection prompt
;; msg – [str] selection prompt
;; arg – [lst] list of ssget arguments

(defun LM:ssget ( msg arg / sel )
(princ msg)
(setvar ‘nomutt 1)
(setq sel (vl-catch-all-apply ‘ssget arg))
(setvar ‘nomutt 0)
(if (not (vl-catch-all-error-p sel)) sel)
)

;; Default Properties – Lee Mac
;; Returns a list of DXF properties for the supplied DXF data,
;; substituting default values for absent DXF groups

(defun LM:defaultprops ( enx )
(mapcar ‘(lambda ( x ) (cond ((assoc (car x) enx)) ( x )))
‘(
(006 . “BYLAYER”)
(008 . “0”)
(039 . 0.0)
(048 . 1.0)
(062 . 256)
(370 . -1)
)
)
)

;; Text Box – gile / Lee Mac
;; Returns an OCS point list describing a rectangular frame surrounding
;; the supplied text or mtext entity with optional offset
;; enx – [lst] Text or MText DXF data list
;; off – [rea] offset (may be zero)

(defun text-box-off ( enx off / bpt hgt jus lst ocs org rot wid )
(cond
( (= “TEXT” (cdr (assoc 00 enx)))
(setq bpt (cdr (assoc 10 enx))
rot (cdr (assoc 50 enx))
lst (textbox enx)
lst
(list
(list (- (caar lst) off) (- (cadar lst) off)) (list (+ (caadr lst) off) (- (cadar lst) off))
(list (+ (caadr lst) off) (+ (cadadr lst) off)) (list (- (caar lst) off) (+ (cadadr lst) off))
)
)
)
( (= “MTEXT” (cdr (assoc 00 enx)))
(setq ocs (cdr (assoc 210 enx))
bpt (trans (cdr (assoc 10 enx)) 0 ocs)
rot (angle ‘(0.0 0.0) (trans (cdr (assoc 11 enx)) 0 ocs))
wid (cdr (assoc 42 enx))
hgt (cdr (assoc 43 enx))
jus (cdr (assoc 71 enx))
org (list (cond ((member jus ‘(2 5 8)) (/ wid -2.0)) ((member jus ‘(3 6 9)) (- wid)) (0.0))
(cond ((member jus ‘(1 2 3)) (- hgt)) ((member jus ‘(4 5 6)) (/ hgt -2.0)) (0.0))
)
lst
(list
(list (- (car org) off) (- (cadr org) off)) (list (+ (car org) wid off) (- (cadr org) off))
(list (+ (car org) wid off) (+ (cadr org) hgt off)) (list (- (car org) off) (+ (cadr org) hgt off))
)
)
)
)
(if lst
( (lambda ( m ) (mapcar ‘(lambda ( p ) (mapcar ‘+ (mxv m p) bpt)) lst))
(list
(list (cos rot) (sin (- rot)) 0.0)
(list (sin rot) (cos rot) 0.0)
‘(0.0 0.0 1.0)
)
)
)
)

;; Matrix x Vector – Vladimir Nesterovsky
;; Args: m – nxn matrix, v – vector in R^n

(defun mxv ( m v )
(mapcar ‘(lambda ( r ) (apply ‘+ (mapcar ‘* r v))) m)
)

;; Start Undo – Lee Mac
;; Opens an Undo Group.

(defun LM:startundo ( doc )
(LM:endundo doc)
(vla-startundomark doc)
)

;; End Undo – Lee Mac
;; Closes an Undo Group.

(defun LM:endundo ( doc )
(while (= 8 (logand 8 (getvar ‘undoctl)))
(vla-endundomark doc)
)
)

;; Active Document – Lee Mac
;; Returns the VLA Active Document Object

(defun LM:acdoc nil
(eval (list ‘defun ‘LM:acdoc ‘nil (vla-get-activedocument (vlax-get-acad-object))))
(LM:acdoc)
)

;;———————————————————————-;;

(vl-load-com)
(princ
(strcat
“n:: BoxText.lsp | Version 1.2 | \U+00A9 Lee Mac ”
(menucmd “m=$(edtime,0,yyyy)”)
” http://www.lee-mac.com ::”
“n:: Type “bt” to Invoke ::”
)
)
(princ)

;;———————————————————————-;;
;; End of File ;;
;;———————————————————————-;;

  • 1
  • 0 0 답변
  • 25 조회
공유
  • 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

    링크 삽입/편집

    대상 URL을 입력하세요

    또는 기존의 콘텐츠에 링크

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