비밀번호를 잊으셨나요?

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

계정이 있나요? 로그인

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 189575
다음
익명
익명
등록일: 2024-04-012024-04-01T23:00:29+09:00 2024-04-01T23:00:29+09:00카테고리: AutoCAD & CADian

TADD 리습의 면적을 변경하고 싶어요

TADD 리습의 면적을 변경하고 싶어요

TADD의 내용 중 면적 구하는 방식을 MM 리습의 면적 구하는 방식으로 변경하고 싶습니다.

직접 수정을 하려고 하니 쉽지 않네요..

TADD 시작———————–
;| ;;
TotalADD Total Addition v. 1.0 ;;
By: Andrea Andreetti 2009-10-20 ;;
|;
;;

(princ
“nTotalADDition v.1.0 activated! -run “TADD” to start or “TADD-r” to end.”
)

(defun c:tadd (/ itemarea itemperimeter itemlinelength
itemarclength itemsplinelength itemregionperimeter itemcircumference
itemsplineperimeter itemplineperimeter itemplinelength itemtracelength
itemarclength itemellipselength a b c d p1 p2 itemlength tarea tperim tlength
)
(vl-load-com)
(defun *oo_object_modification* (objreactor objectsmodified)
(setq selected_objects (vla-get-pickfirstselectionset
(vla-get-activedocument (vlax-get-acad-object))
)
)
(setq itemarea 0
itemperimeter 0
itemlinelength 0
itemarclength 0
itemsplinelength 0
itemregionperimeter 0
itemcircumference 0
itemsplineperimeter 0
itemplineperimeter 0
itemplinelength 0
itemtracelength 0
itemarclength 0
itemellipselength 0
)
;AREA
(vlax-for n selected_objects
(if (vlax-property-available-p n ‘area)
(if (eq (vla-get-objectname n) “AcDbRegion”)
(setq itemarea (+ itemarea (vla-get-area n)))
(if (vlax-curve-isclosed n)
(setq itemarea (+ itemarea (vla-get-area n)))
)
)
)
;;CIRCLE
(if (vlax-property-available-p n ‘circumference)
(setq itemcircumference (+ itemcircumference (vla-get-circumference n)))
)
;;SPLINE
(if (eq (vla-get-objectname n) “AcDbSpline”)
(if (vlax-curve-isclosed n)
(setq itemsplineperimeter (+ itemsplineperimeter
(vlax-curve-getdistatparam n (vlax-curve-getendparam n))
)
)
(setq itemsplinelength (+ itemsplinelength
(vlax-curve-getdistatparam n (vlax-curve-getendparam n))
)
)
)
)
;;REGION
(if (eq (vla-get-objectname n) “AcDbRegion”)
(setq itemregionperimeter (+ itemregionperimeter (vla-get-perimeter n)))
)
;;PLINE
(if (or (eq (vla-get-objectname n) “AcDb2dPolyline”)
(eq (vla-get-objectname n) “AcDbPolyline”)
)
(if (vlax-curve-isclosed n)
(setq itemplineperimeter (+ itemplineperimeter
(vlax-curve-getdistatparam n (vlax-curve-getendparam n))
)
)
(setq itemplinelength (+ itemplinelength
(vlax-curve-getdistatparam n (vlax-curve-getendparam n))
)
)
)
)
;;LINE
(if (eq (vla-get-objectname n) “AcDbLine”)
(setq itemlinelength (+ itemlinelength (vla-get-length n)))
)
;;ARC
(if (eq (vla-get-objectname n) “AcDbArc”)
(setq itemarclength (+ itemarclength (vla-get-arclength n)))
)
(if (eq (vla-get-objectname n) “AcDbEllipse”)
(setq itemellipselength (+ itemellipselength
(vlax-curve-getdistatparam n (vlax-curve-getendparam n))
)
)
)
;;TRACE
(if (eq (vla-get-objectname n) “AcDbTrace”)
(progn (setq plist (vlax-safearray->list
(vlax-variant-value (vla-get-coordinates n))
)
)
(setq a (list (nth 0 plist) (nth 1 plist) (nth 2 plist)))
(setq b (list (nth 3 plist) (nth 4 plist) (nth 5 plist)))
(setq c (list (nth 6 plist) (nth 7 plist) (nth 8 plist)))
(setq d (list (nth 9 plist) (nth 10 plist) (nth 11 plist)))
(setq p1 (polar a (angle a b) (/ (distance a b) 2.0)))
(setq p2 (polar c (angle c d) (/ (distance c d) 2.0)))
(setq itemtracelength (+ itemtracelength (distance p1 p2)))
)
)
)
;;_end vlax-for
(setq itemperimeter (+ itemcircumference
itemsplineperimeter
itemregionperimeter
itemplineperimeter
)
)
(setq itemlength (+ itemplinelength itemsplinelength itemlinelength itemtracelength itemarclength itemellipselength)
)
(setq tarea (rtos itemarea 2 8))
(setq tperim (rtos itemperimeter 2 8))
(setq tlength (rtos itemlength 2 8))
(acet-ui-status (strcat “Toatl Area: ” tarea “n” “Total Perimeter: ” tperim “n”
“Total Length: ” tlength)
)
)
;;OBJECT SELECTION
(if oo_object_modification
(progn (vlr-remove oo_object_modification)
(setq oo_object_modification nil)
)
)
(setq oo_object_modification
(vlr-miscellaneous-reactor
nil
‘((:vlr-pickfirstmodified . *oo_object_modification*))
)
)
;;Command ended
(if oo_object_modification_action
(progn (vlr-remove oo_object_modification_action)
(setq oo_object_modification_action nil)
)
)
(setq oo_object_modification_action
(vlr-command-reactor nil
‘((:vlr-commandended . *oo_object_modification*)
;(:vlr-commandcancelled . *oo_object_modification_CANCEL*))
)
)
)
)

(defun c:TADD-r ()

(if oo_object_modification_action
(progn (vlr-remove oo_object_modification_action)
(setq oo_object_modification_action nil)
)
)
(if oo_object_modification
(progn (vlr-remove oo_object_modification)
(setq oo_object_modification nil)
)
)
)
TADD 끝———————–

MM 시작———————–
;—————————————————————————;
; ;
; ;
; ;
; ;
; 인터넷 이곳저곳…. 말씀해주세요… ;
; 저작권 문제가 된다면 수정하겠습니다. http://szpl.tistory.com/ ;
; Zebra Pattern Lemon ;
; ;
; 레이어 제어 리습 명령어 참조 : http://szpl.tistory.com/11 ;
; ;
; ;
; ;
; ;
;—————————————————————————;
(defun c:mm ( / doc space ss index obj mi mx minpt maxpt inspt area txtobj )
(setvar “cmdecho” 0)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(cond
((= (vla-get-activespace doc) 1) (setq space (vla-get-modelspace doc)))
((= (vla-get-activespace doc) 0) (setq space (vla-get-paperspace doc)))
)
(if (setq ss (ssget (list (cons 0 “CIRCLE,ARC,*POLYLINE,LINE,ELLIPSE,SPLINE”))))
(if (or (setq ts (getreal (strcat “n텍스트 높이 입력 :”))) (setq ts (getvar “textsize”)))
(progn
(setvar “textsize” ts)
(setq index 0)
(repeat (sslength ss)
(setq obj (vlax-ename->vla-object (ssname ss index)))
(vla-getboundingbox obj ‘mi ‘mx)
(setq minpt (vlax-safearray->list mi) maxpt (vlax-safearray->list mx))
(setq inspt (polar minpt (angle minpt maxpt) (/ (distance minpt maxpt) 2)))
(setq inspt (list (car inspt) (+ (cadr inspt) (* ts 2))))
(setq area (vla-get-area obj) len (vlax-curve-getdistatparam obj (vlax-curve-getendparam obj)))
(mapcar ‘(lambda (a b)
(setq p (vlax-3d-point inspt))
(setq txtobj (vla-addtext space (strcat a b) p ts))
(vla-put-alignment txtobj 4)
(vla-put-textalignmentpoint txtobj p)
(setq inspt (polar inspt (/ (* 270 pi) 180) (* ts 2)))
)
‘(“평 : ” “면적(㎡) : ” “길이(mm) : ” ) (list (rtos (/ area 3305796.) 2 2) (rtos (/ area 1000000.) 2 3) (rtos len 2 2))
)
(setq index (1+ index))
)
(command “chprop” (ssget “x” ‘((0 . “TEXT”) (1 . “평*”))) “” “c” “7” “”)
)
)
)
(princ)
)
(vl-load-com)
(prompt “n[ AAA ]”)
(princ)
MM 끝———————–

MM의 리습으론 면적이 잘 나오는데 TADD 리습은 면적을 되는건 되고 안되는건 안되네요ㅜㅜ

  • 0
  • 0 0 답변
  • 274 조회
공유
  • Facebook

    관련 있는 질문들

    • mvsetup 및 align 안됨
    • mvsetup 및 align 안됨
    • 에어컨 실외기 도면
    • cad에서 기준점 복사 후 다른 파일에 붙여넣기 시 블록참조객체의 길이가 줄어들어있어요

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

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

    비밀번호를 잊으셨나요?

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

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

    또는 기존의 콘텐츠에 링크

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