아래와 같은 면적과 선분의 길이를 구하는 리습을 사용하고 있는데요
전에는 안그랬는데 최근 캐드를 다시 깔고 하는데
명령어를 치면 로딩시간이 생기고
면적계산 값이 나올때도 로딩시간이 생깁니다…
이방법 저방법 다 해봤는데 해결방법을 모르겠네요
;;; AT.lsp
;;; (C) Copyright 1988-1992 by Autodesk, Inc.
;;;
;;; This program is copyrighted by Autodesk, Inc. and is licensed
;;; to you under the following conditions. You may not distribute
;;; or publish the source code of this program in any form. You
;;; may incorporate this code in object form in derivative works
;;; provided such derivative works are (i.) are designed and
;;; intended to work solely with Autodesk, Inc. products, and
;;; (ii.) contain Autodesk’s copyright notice “(C) Copyright
;;; 1988-1992 by Autodesk, Inc.”
;;;
;;; AUTODESK PROVIDES THIS PROGRAM “AS IS” AND WITH ALL FAULTS.
;;; AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF MER-
;;; CHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
;;; DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
;;; UNINTERRUPTED OR ERROR FREE.
;;;
;;; by Jin S. Oh
;;; 29 October 1996
;;;
;;; REVISIONS
;;; 1.01 22 May 1991 DTP — Minor bug fixes.
;;; 1.02 18 June 1991 JSY, DTP — Minor bug fixes.
;;; 1.03 7 December 2000
;;;————————————————————————–;
;;; DESCRIPTION
;;; This is a “text processor” which operates in a global manner
;;; on all of the text entities that the user selects; i.e., the
;;; Height, Justification, Location, Rotation, Style, Text, and
;;; Width can all be changed globally or individually, and the
;;; range of values for a given parameter can be listed.
;;;—————————————————————————;
;;;
;;; Main function — no arguments
;;;
(defun aaa (/ SW opt1 unctr ct_ver aa_er aa_oe
p1 p2 ars d dd
aa_oc aa_ot aa_oh loc loc1 )
(setq ct_ver “1.03”) ; Reset this local if you make a change.
(setq digt 2)
(setvar “dimzin” 0)
;;
;; Internal error handler defined locally
;;
(defun aa_er (s) ; If an error (such as CTRL-C) occurs
; while this command is active…
(if (/= s “Function cancelled”)
(if (= s “quit / exit abort”)
(princ)
(princ (strcat “nError: ” s))
)
)
(eval(read U:E))
(if aa_oe ; If an old error routine exists
(setq *error* aa_oe) ; then, reset it
)
(if temp (redraw temp 1))
(if aa_oc (setvar “cmdecho” aa_oc)) ; Reset command echoing
(if aa_os (setvar “osmode” aa_os))
(if aa_oh (setvar “highlight” aa_oh))
(princ)
)
;;
;; Body of function
;;
(if *error* ; Set our new error handler
(setq aa_oe *error* *error* aa_er)
(setq *error* aa_er)
)
;; Set undo groups and ends with (eval(read U:G)) or (eval(read U:E))
(setq U:G “(command ”undo” ”group”)”
U:E “(command ”undo” ”en”)”
)
(setq aa_oc (getvar “cmdecho”))
(setq aa_os (getvar “osmode”))
(setq aa_oh (getvar “highlight”))
(setvar “cmdecho” 0)
(eval(read U:G))
(princ (strcat “nChange text, Version ” ct_ver
“, (c) 1990-1996 by Hanyoung, Inc. “))
;; This is the main option loop.
(setq unctr 0)
(aa_ol)
(if aa_oe (setq *error* aa_oe)) ; Reset old error function if error
(eval(read U:E))
(if aa_os (setvar “osmode” aa_os))
(if aa_oh (setvar “highlight” aa_oh))
(if aa_oc (setvar “cmdecho” aa_oc)) ; Reset command echoing
(princ)
)
;;;
;;; The option loop.
;;;
(defun aa_ol ()
(setq sw T)
(if (= chr_cm nil)
(progn
(setq opt “D”
chr_cm “D”))
(setq opt chr_cm));if
(while sw
(setq unctr (1+ unctr))
(command “_.UNDO” “_GROUP”)
(initget “D A B U X”)
(setq opt1 (getkword
(strcat “nDist line/Area line/area Boundary/Undo/eXit <” chr_cm “>: “)))
(if opt1 (setq opt opt1))
(if opt
(cond
((= opt “X”)
(setq sw nil) ; Exit command.
)
((= opt “U”)
(setq chr_cm “U”)
(aa_ue) ; Undo the previous command.
)
((= opt “D”)
(setq chr_cm “D”)
(aa_dl) ; Distance.
)
((= opt “A”)
(setq chr_cm “A”)
(aa_al) ; Area.
)
((= opt “B”)
(setq chr_cm “B”)
(aa_ab) ; Boundary Area.
)
)
)
(command “_.UNDO” “_END”)
)
)
;;;
;;; Undo an entry.
;;;
(defun aa_ue ()
(if (> unctr 1)
(progn
(command “_.UNDO” “_END”)
(command “_.UNDO” “2”)
(setq unctr (- unctr 2))
)
(progn
(princ “nNothing to undo. “)
(setq unctr (- unctr 1))
)
)
)
;;;
;;;Distance-line
;;;
(defun aa_dl ()
(graphscr)
(if aa_os (setvar “osmode” aa_os))
(setq d 0 dd 0)
(while (setq p1 (getpoint “n First point : “))
(command “pline” p1)
(while (setq p2 (getpoint P1 “n Next point : “))
(setq d (+ d (distance p1 p2)))
(command p2)
(setq p1 p2))
(setq dd (+ dd d))
(setq d 0)
(command “”)
(princ “n Add ? < No -> Enter > “))
(princ “n Distance : “)(princ (rtos dd 2 digt))(princ ” m”)
(SETQ ARS (RTOS DD 2 digt))
(PUTTEXT)
)
;;;
;;; Area
;;;
(defun aa_ab2 ()
(graphscr)
(setvar “osmode” 0)
(setq pp (getpoint “nPick point area : “)) (terpri)
(if pp ;1
(progn
(bpoly pp)
(command “area” “e” “l” )
(setq are (getvar “area”))
(if are ;2
(progn
(setq ars (rtos are 2 digt))
(princ “n Area = “)
(princ are) (terpri)
(PUTTEXT)
(princ));;progn
);;if2
));;if1
)
(defun aa_ab ()
(graphscr)
(setvar “osmode” 0)
(setq d 0 dd 0)
(while (setq p1 (getpoint “nPick point area : “))
(bpoly p1)
(setq aa (entlast))
(command “area” “e” aa )
(setq are (getvar “area”))
(if are ;2
(progn
(setq ars (rtos are 2 digt))
(princ “n Area = “)
(princ are) (terpri)
(setq dd (+ dd are))
);progn
);if
(princ “n Add ? < No -> Enter > “)
)
(princ “n Area = “)(princ (rtos dd 2 digt))(princ ” m^2″)
(SETQ ARS (RTOS DD 2 digt))
(PUTTEXT)
)
;;;
;;;Area-line
;;;
(defun aa_al()
(setq aa 0)
(while (setq p1 (getpoint “n First point : “))
(command “pline” p1)
(while (setq p2 (getpoint P1 “n Next point : “))
(command p2)
(SETQ P1 P2))
(command “”)
(command “area” “e” “l”)
(command “redraw”)
(setq aa (+ aa (getvar”area”)))
(princ “n Add ? < No -> Enter > “))
(princ “n Area : “)(princ (rtos aa 2 digt))(princ ” m^2″)
(SETQ ARS (RTOS AA 2 digt))
(PUTTEXT)
)
;; Put Text
(DEFUN PUTTEXT(/ TT)
(if (setq tt (entsel “n Target : “))
(command “change” tt “” “” “” “” “” “” ars)
)
(princ)
);;PUTTEXT
(defun PUTTEXT2(/ X Y XY)
(if aa_os (setvar “osmode” aa_os))
(IF (setq ptxt (getpoint “nPick Text point : “))
(PROGN
(TERPRI)
(SETQ X (CAR PTXT))
(SETQ Y (CAR (CDR PTXT)))
(SETQ XY (LIST (+ X 2.5) (+ Y 0.25)))
(setvar “osmode” 0)
(command “text” “R” XY “0.5” “” ars)
(if aa_os (setvar “osmode” aa_os))
));;PROGN
);;PUTTEXT2
;;;
;;; The C: function definition.
;;;
(defun c:aa() (aaa))
(princ “ntc:AA loaded. Start command with AA.”)
(princ)
;;;
;;; Add Text
;;;
(defun c:zz(/ tot ind ent)
(setvar “cmdecho” 0)
(prompt “n>>select first text : “)
(setq tot1(ssget))
(setq a (entget(ssname tot1 0)))
(setq b (assoc 1 a))
(setq c (cdr b))
(setq cc (atof c))
(prompt “n>>select second text : “)
(setq tot2(ssget))
(setq a (entget(ssname tot2 0)))
(setq b (assoc 1 a))
(setq c (cdr b))
(setq ccc (atof c))
(setq number (+ cc ccc))
(setq ar (rtos number 2 1))
(princ (strcat “area ==> “(rtos number 2 1)))
(princ “select change text”)
(setq ss (ssget))
(command “change” ss “” “” “” “” “” “” ar)
(setvar “cmdecho” 1)
(princ)
)