Dear All,
i'm trying create layer & text style but not create text style & text boundary.
confusion mark is red
;;------------------------------------------------------------;;
;; This Program Created area of pline (@ mm Drawing only) ;;
;;------------------------------------------------------------;;
(defun c:CA nil (c:CarpetArea))
(defun c:CarpetArea ( / *error* _EndUndo _StartUndo p5 p6 a b c d e f s )
(vl-load-com)
;;------------------------------------------------------------;;
;; SubFunctions ;;
;; Error Handler ;;
;;------------------------------------------------------------;;
;; © Lee Mac 2010 ;;
(defun *error* ( msg )
[color=red] (if doc (_EndUndo doc))[/color]
(or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
(princ (strcat "\n** Error: " msg " **")))
(princ)
)
[color=red](defun _StartUndo ( doc ) (_EndUndo doc)
(vla-StartUndoMark doc)
)
(defun _EndUndo ( doc )
(if (= 8 (logand 8 (getvar 'UNDOCTL)))
(vla-EndUndoMark doc)[/color]
)
)
;;------------------------------------------------------------;;
;;--------------------- Create Layer & Text Style ------------;;
(if(not(tblsearch "LAYER" "Tx"))
(command "-layer" "new" "Tx" "Color" 4 "Tx" "LTYPE" "Continuous" "Tx" "")
);end if
(setvar "clayer" "Tx")
(setvar "celtype" "bylayer")
(setvar "cecolor" "bylayer")
(setvar "insunits" 0)
[color=red](if(not(tblsearch "Style" "Tx"))
(command "-style" "tx" "ARIAL" "0" "1" "0" "" "" ""))
; ((0 . "STYLE") (2 . "Tx") (70 . 0) (40 . 0.0) (41 . 1.0) (50 . 0.0) (71 . 0) (42 . 0.3) (3 . "txt") (4 . ""))
);end if
;(getvar "textstyle" "rd")[/color]
;;-----------------------------------------------------------;;
(if (and (setq s (ssget "_:S:E" '((0 . "LWPOLYLINE"))))
(setq p5 (getpoint "\nWHERE TO PLACE TEXT: "))
)
(progn
(setq p5 (polar p5 pi 1250))
(setq p6 (polar p5 0 2500))
;(setq fn (getstring t "\nFLAT NO.:"))
(command "._area" "_e" (ssname s 0))
(SETQ A (GETVAR "AREA"))
(setq f (* A 0.000010764))
(setq f (rtos f 2 2))
(SETQ f (strcat f " SQ. FT."))
(SETQ B (/ A 1000000))
(SETQ C (RTOS B 2 2))
(SETQ D "CARPET AREA")
;(setq e (strcat FN " = " C " SQ.MT."))
(setq e (strcat "= " C " SQ.MT."))
(setq F (strcat "= " F))
[color=red](COMMAND "_TEXT" "_S" "standard" "_f" P5 p6 "225" D
"_text" "" e
"_text" "" f
"_.rectangle"
(mapcar '+ P5 '(-165 440 0))
(mapcar '+ P6 '(165 -1045 0))[/color]
); end command
); End Progn
(princ "\n ~¤~ ...Type \"Ca\" to Invoke... ~¤~ ")
)
(princ)
;; Exit Cleanly
)
;; End defun
;;;;;;;;; ------ End Program ---