비밀번호를 잊으셨나요?

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

계정이 있나요? 로그인

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 100616
다음
Lv.0
등록일: 2014-03-112014-03-11T14:44:43+09:00 2014-03-11T14:44:43+09:00카테고리: AutoCAD & CADian

LISP 조언 부탁드립니다.

리습을 실행하면
두개의 블럭이 삽입이 되면서 1번 그림과 같이 회전하는 방향에 맞게 꼬리쪽블록이 생성되야하는데
1번 그림

1.jpg

2번 그림
2.jpg

2번 그림처럼 앞쪽의 블록은 회전하여 삽입이 잘되는데 꼬리쪽블록은 무조건 고정이 되어서
삽입이 됩니다.
리습의 전문은 아래와 같습니다.
어느부분에서 문제가 있는걸까요? 조언 부탁드립니다.
(defun c:hw (/ current_dimscale insert_point insert_path1 insert_path2 rotate_entity read_hw_string hw_string text_point
             dir_point)
 (Setq current_dimscale (getvar “dimscale”))
 (prompt “n ** << 삽입점을 선택하면 단면표시을 자동으로 작도하는  명령어 입니다 >> **” ) 
 (while
   (Setq insert_point (getpoint “n종료(Enter)/삽입점을 찍으세요.”) )
   (Setq insert_path1 (strcat  “IAD\hw1.dwg”))
   (Setq insert_path2 (strcat  “IAD\hw2.dwg”))
   (Setq rotate_entity (ssadd))
   (if (= (tblsearch “block” “hw1”) nil)
     (progn
      (command “-insert” insert_path1 insert_point current_dimscale current_dimscale “1” “0”)
      (ssadd (entlast) rotate_entity)
      (entmod (subst (cons 8 oc_layer_7)(assoc 8 (entget (entlast))) (entget (entlast))))
     )
     (progn
       (entmake (list (cons 0 “insert”)
                      (cons 2 “hw1”);블록명
                      (cons 8 “ch”);레이어
                      (cons 10 insert_point)
                      (cons 41 current_dimscale);X scale factor
                      (cons 42 current_dimscale);Y scale factor
                      (cons 43 1);Z scale factor
                )
       )
       (ssadd (entlast) rotate_entity)
     )
   );end if
   (Setq block_hw1 (entlast))
   (Setq read_hw_string (getcfg “hw1”))
   (if (= read_hw_string1 nil)
     (Setq read_hw_string1 “C”)
   );end if
   (Setq hw_string1 (getstring (strcat “n단면 문자1를 입력하세요.<” read_hw_string1 “>:”)))
   (if (or (= hw_string1 nil) (= hw_string1 “”))
     (Setq hw_string1 read_hw_string1)
   );end if
   (Setq text_point (polar insert_point (dtr 90) (* current_dimscale 3)))
   (f:make_text text_point text_point (* current_dimscale 3)
                     256 1 2  “te” “romans” hw_string1 0 0.8);mc
   (ssadd (entlast) rotate_entity)
   (Setq read_hw_string2 (getcfg “hw2”))
   (if (= read_hw_string2 nil)
     (Setq read_hw_string2 “1”)
   );end if
   (Setq hw_string2 (getstring (strcat “n단면 문자2를 입력하세요.<” read_hw_string2 “>:”)))
   (if (or (= hw_string2 nil) (= hw_string2 “”))
     (Setq hw_string2 read_hw_string2)
   );end if
   (Setq text_point (polar insert_point (dtr 270) (* current_dimscale 3)))
   (f:make_text text_point text_point (* current_dimscale 3)
                     256 1 2  “te” “romans” hw_string2 0 0.8);mc
   (ssadd (entlast) rotate_entity)
   (princ “n단면 기호 방향에 점을 찍으세오.”)
   (command “rotate” rotate_entity “” insert_point pause)
   (Setq insert_point2 (getvar ‘lastpoint))
   (Setq insert_angle (angle insert_point insert_point2))
   (if (/= (cdr (assoc 50 (entget block_hw1)))  insert_angle)
     (progn
       (Setq insert_agnle (cdr (assoc 50 (entget block_hw1))))
       (cond
         ((or (= insert_agnle 0)(= insert_agnle pi))
           (Setq insert_point2 (list (nth 0 insert_point2)(nth 1 insert_point)))
         )
         ((or (= insert_agnle (dtr 90))(= insert_agnle (* 2 pi)))
           (Setq insert_point2 (list (nth 0 insert_point)(nth 1 insert_point2)))
         )
       );end cond
     )
   );end if
   (if (= (tblsearch “block” “hw2”) nil)
     (progn
      (command “-insert” insert_path2 insert_point2 current_dimscale current_dimscale “1” (rtd (angle insert_point insert_point2)))
      (entmod (subst (cons 8 “ch”)(assoc 8 (entget (entlast)))(entget (entlast))))
     )
     (progn
       (entmake (list (cons 0 “insert”)
                      (cons 2 “hw2”);블록명
                      (cons 8 “ch”);레이어
                      (cons 10 insert_point2)
                      (cons 41 current_dimscale);X scale factor
                      (cons 42 current_dimscale);Y scale factor
                      (cons 43 1);Z scale factor
                      (cons 50 (angle insert_point insert_point2));rotation angle
                )
       )
     )
   );end if
   (setcfg “hw1” hw_string1)
   (setcfg “hw2” hw_string2)
 )
(prin1)
)
  • 0
  • 19 조회
공유
  • Facebook

    관련 있는 질문들

    • MDW파일 DWG파일로 변환 부탁드리겠습니다.
    • 직선의 한 지점에서 원의 최대거리 선 그리기
    • 캐드 모깎기 질문 드립니다
    • 블럭깰때 가시성으로 가려진 블럭들 처리

    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