리습을 잘 모르는 초보입니다.
인터넷에서 좋은 소스를 받았는데..
아래와 같은 리습을 사용하면 면적을 자동으로 구해서 텍스트로 적어줍니다.
이 면적을 텍스트로 적기전에 어떤수 예를 들어서 면적이 20이면 이 수에 3.45같은 일정한 값을 곱해서 표기하고 싶습니다.
어떤부분을 수정하면 될까요?
답변 부탁드립니다.. 감사합니다..
;============================================================================
;
; [[[ LISP Program ]]]
;
; 쓰 임 새 : 면적산출
;
;============================================================================
(defun clerr (s)
(if (/= s “Function cancelled”)(princ (strcat “nError: ” s)))
(setvar “blipmode” 0)
(SETVAR “osmode” osm1)
(setvar “clayer” cl1)
(COMMAND “layer” “on” “4545” “”)
(command “redraw”)
(setq *error* olderr)
(princ “n* * * 확 인 바 람 * * *”)(princ)
)
(defun sss1(/ t1)
(command “area” “o” o1)
(setq aa2 (getvar “area”))
(setq a2 (* sc2 aa2));면적변환 – scale별로….
(setq ct1 (+ ct1 1))
(cond ((= ct1 1)(setq hat1 “ansi31”)(command “color” “5”))
((= ct1 2)(setq hat1 “dash”)(command “color” “7”))
((= ct1 3)(setq hat1 “net”)(command “color” “8”))
((= ct1 4)(setq hat1 “trans”)(command “color” “21”))
)
;면적에 해치 (command “hatch” hat1 “1000” “0” o1 “”)
(command “color” “bylayer”)
(if (= ct1 4)(setq ct1 0))
(setq t1 (getINT “n공부상 (1) / < 편입면적 > “))
(cond ((= t1 1)(setq a3 “공”))(t (setq a3 (rtos a2 2 1))))
(COMMAND “layer” “S” “ar2” “”)
(command “text” “j” “mc” p1 “0” A3)
(princ “n——- Area = “)(princ a3)(princ ” ——-“)
)
(defun c:aaa (/ p1 osm1 )
(setq olderr *error*
*error* clerr)
(SETVAR “CMDECHO” 0)
(SETQ OSM1 (GETVAR “OSMODE”))
(setq cl1 (getvar “clayer”))
(SETVAR “BLIPMODE” 1)
(SETVAR “osmode” 0)
; –Define Layer —
(setq ts (tblsearch “LAYER” “ar1”))
(if (null ts)(command “layer” “m” “Ar1” “c” “5” “” “”))
(setq ts (tblsearch “LAYER” “ar2”))
(if (null ts)(command “layer” “m” “Ar2” “c” “1” “” “”))
; — Define Style —
(if (= he2 nil)
(setq he1 (getreal “n 면적을 쓸 TEXT의 높이는 : 재입력 /
)
(if (= he1 nil)(setq he2 2.0)(setq he2 he1))
(setq ts (tblsearch “style” “ghs”))
(if (null ts)
(command “style” “ghs” “romans.shx,ghs.shx” he2 “” “” “” “”)
(command “style” “ghs” “” he2 “” “” “” “”)
)
; — Define Scale —
(if (= sc2 nil)
(setq sc1 (getreal “n 도면의 Scale은 <1:1000> = 1 : “))
)
(if (= sc1 nil)
(setq sc2 1)
(setq sc2 (* (/ sc1 1000) (/ sc1 1000)))
)
(COMMAND “layer” “off” “4545” “”)
; –MAIN–
(setq ro1 1)
(setq ct1 0)
(while (setq p1 (getpoint “n해당필지 : “))
(COMMAND “layer” “S” “ar1” “”)
(command “boundary” p1 “”)
(setq o1 (ssget “l”))
(sss1)
); –while–
(command “redraw”)
(SETVAR “osmode” osm1)
(setvar “clayer” cl1)
(COMMAND “layer” “on” “4545” “”)
(SETVAR “BLIPMODE” 0)
(princ)
)