비밀번호를 잊으셨나요?

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

계정이 있나요? 로그인

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 96684
다음
Lv.0
등록일: 2012-11-202012-11-20T09:06:49+09:00 2012-11-20T09:06:49+09:00카테고리: AutoCAD & CADian

xcsh님 두 번째 작품입니다. 봐주세요^^

두 직선에 접하는 호 그리는 리습입니다. 

제목 없음.png
; Draws a arc with a specified radius and tangent to two lines. 
  ; approach: outside point of a circle / direction from the point / finding center point
    ;           tangent points from the pythagorean theorem  c^2 = a^2 + b^2
  
(defun c:ttr()
(setq radi (getdist “Enter radius”))                                     ;Specifying radius
 (setvar “osmode” 0)                                                        ;Osnap None
  (setq ftl (entsel))                                                           ;First tangent line
 (setq stl (entsel))                                                            ;Second tangent line
 (setq fsp (cdr (assoc 10 (entget (car ftl)))))                     ;Start point of the ftl
 (setq fep (cdr (assoc 11 (entget (car ftl)))))                    ;Endpoint of the ftl
 (setq ssp (cdr (assoc 10 (entget (car stl)))))               ;Start point of the stl
 (setq sep (cdr (assoc 11 (entget (car stl)))))                ;Endpoint of the stl
 (setq pt1 (inters fsp fep ssp sep nil))                             ;Intersection point
  (setq mpt1 (mapcar ‘(lambda (x) (/ x 2.0) ) (mapcar ‘+ fsp fep)))   ;Midpoint of the ftl
 (setq mpt2 (mapcar ‘(lambda (x) (/ x 2.0) ) (mapcar ‘+ ssp sep)))    ;Midpoint of the stl
    (setq centroid (mapcar ‘(lambda (x) (/ x 3.0) ) (mapcar ‘+ pt1 mpt1 mpt2))) 
    ;Centroid of the three points, determining offset direction.
  (command “offset” radi ftl centroid “”)                         ;Offset line from the ftl
 (setq line1 (entlast))
 (command “offset” radi stl centroid “”)                         ;Offset line from the stl
 (setq line2 (entlast))
 (setq dxf1 (entget  line1))
 (setq sp1 (cdr (assoc 10 dxf1)))                                        ;Start point of the line1                       (setq ep1 (cdr (assoc 11 dxf1)))                                          ;Endpoint of the line1
 (setq dxf2 (entget  line2))
 (setq sp2 (cdr (assoc 10 dxf2)))                                           ;Start point of the line2 
 (setq ep2 (cdr (assoc 11 dxf2)))                                             ;Endpoint of the line2
 (setq center (inters sp1 ep1 sp2 ep2 nil))                                ;Center of the arc
 (setq dist (distance pt1 center))              ;Distance betweeon pt1 and center (hypotenuse)
 (setq tl(sqrt (- (expt dist 2) (expt radi 2))))                      ;Tangent legnth from pt1
 (setq tpt1 (polar pt1 (angle pt1 mpt1) tl))                                     ;Tangent point1
  (setq tpt2 (polar pt1 (angle pt1 mpt2) tl))                                   ;Tangent point2
  (command “erase” line1 line2 “”)
    (command “arc” tpt1 “E” tpt2 “d” pt1 )        
    ;Draws the arc using starpoint, endpoint, tangent direction
  (setvar “osmode” (+ 1 32 128 2048))
(princ)
  )
  • 0
  • 7 조회
공유
  • Facebook

    관련 있는 질문들

    • 객체 전체 간격 조정 할수 있을까요?
    • 블록 안에서 블록을 만들 수 있나요? 과거에는 됐었는데 2023부터 안되나요?
    • 캐드 2023 find 명령어가 너무 느립니다.
    • 폴리선 각도에 맞는 문자를 폴리선위에 올리고싶습니다. (관로선형에 위에문자올릴때)

    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