Dear All,
Please Help me
I was created text style & layer if not found 1) text style (xyz) , layer (text) & same pline layer (text) around the text
- ;;------------------------------------------------------------;;
- ;; Carpet Area Program ;;
- ;; This Program Created area of pline (@ mm Drawing only) ;;
- ;;------------------------------------------------------------;;
- (defun c:CA nil (c:CarpetArea))
- (defun c:CarpetArea (/ *error* p5 p6 a b c d e f s)
- (vl-load-com)
- ;;------------------------------------------------------------;;
- ;; please add ;;
- ;; Error Handler ;;
- ;;------------------------------------------------------------;;
- ;;--------- entmake ------------;;
- ;;--------------- if not found Layer & Text Style ------------;;
- ;;------------------ Create Layer & Text Style ---------------;;
- ;; layer = xyz
- ;; text style = room
- ;; pline layer around text = xyz
-
-
- ;;------------------------------------------------------------;;
- (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))
- (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 "= " C " SQ.MT."))
- (setq F (strcat "= " F))
- ;;------------------------------------------------------------;;
- (COMMAND "_TEXT" "_S" "room" "_f" P5 p6 "250" D
- "_text" "" e
- "_text" "" f
- "_.rectangle"
- (mapcar '+ P5 '(-165 440 0))
- (mapcar '+ P6 '(165 -1045 0))
- ) ; end command
- ;;------------------------------------------------------------;;
- );; End Progn
- (princ "\n ~¤~ ...Type "Ca" to Invoke... ~¤~ ")
- );; End IF
- (princ)
- ;; Exit Cleanly
- );; End defun
- ;;----------------------End Program --------------------------;;
|