I have a lisp file which works well at present using -bhatch for hatching by selecting a point inside boundary (c_sand, c_conc etc..) see below. I am trying to add a section to ask for a "p" or "s" (yet to be written and either use the point hatch as shown or selet objects (hatch) I have written the section s_sand (directly below c_sand) but the scaling is failing. I presume the line: (command "hatch" "ar-sand" "hpscale" 0 "") is wrong, Im new to this so it may be something obvious. Any suggestions please full code:- (defun MyError (strErr) (setvar "OSMode" INOS) (setvar "clayer" INLAYER) (setvar "cecolor" incolor) (princ) ) ;;;STANDARD HATCH PATTERNS ;;; (defun layerht () (command "layer" "M" "HATCH" "") (setq cur_hatccolor (getvar "cecolor") cur_hatclayer "HATCH" cur_hatcltype (getvar "celtype") ) ) =========================================================================================== ========================================================================================== (defun c_inset () (setq inlayer (getvar "clayer")) (setq incolor (getvar "cecolor")) (setq inltype (getvar "celtype")) (setq inort (getvar "orthomode")) (setq inos (getvar "osmode")) (setq inpkbx (getvar "pickbox")) (setq inplwd (getvar "plinewid")) ) (defun c_outset () (setvar "clayer" inlayer) (setvar "cecolor" incolor) (setvar "celtype" inltype) (setvar "orthomode" inort) (setvar "osmode" inos) (setvar "pickbox" inpkbx) (setvar "plinewid" inplwd) ) =========================================================================================== =========================================================================================== ;;;SAND (defun c:c_sand () (setq *error* myerror) (if scale (setq sc1 (rtos scale 2 2)) (setq sc1 "")) (setq sc1 (getdist (strcat " input scale <" sc1 ">: "))) (if sc1 (setq scale sc1)) (setvar "cmdecho" 0) (c_inset) (layerht) (setvar "hpname" "ar-sand") (setvar "hpang" 0) (setvar "hpscale" (* 0.1 scale)) (princ " Select area to hatch") (command "-bhatch" pause "") (setvar "cmdecho" 1) (c_outset) (princ) ) (defun c:s_sand () (setq *error* myerror) (if scale (setq sc1 (rtos scale 2 2)) (setq sc1 "")) (setq sc1 (getdist (strcat " input scale <" sc1 ">: "))) (if sc1 (setq scale sc1)) (setvar "cmdecho" 0) (c_inset) (layerht) (setvar "hpscale" (* 0.1 scale)) (command "hatch" "ar-sand" "hpscale" 0 "") (setvar "cmdecho" 1) (c_outset) (princ) ) ;;;DOTS (defun c:c_dots () (setq *error* myerror) (if scale (setq sc1 (rtos scale 2 2)) (setq sc1 "")) (setq sc1 (getdist (strcat " input scale <" sc1 ">: "))) (if sc1 (setq scale sc1)) (setvar "cmdecho" 0) (c_inset) (layerht) (setvar "hpname" "dots") (setvar "hpscale" (* 2 scale)) (setvar "hpang" 0) (princ " Select area to hatch") (command "-bhatch" pause "") (setvar "cmdecho" 1) (c_outset) (princ) ) ;;;CONCRETE (defun c:c_concrete () (setq *error* myerror) (if scale (setq sc1 (rtos scale 2 2)) (setq sc1 "")) (setq sc1 (getdist (strcat " input scale <" sc1 ">: "))) (if sc1 (setq scale sc1)) (setvar "cmdecho" 0) (c_inset) (layerht) (setvar "hpname" "ar-conc") (setvar "hpscale" (* 0.1 scale)) (setvar "hpang" 0) (princ " Select area to hatch") (command "-bhatch" pause "") (setvar "cmdecho" 1) (c_outset) (princ) ) ;;;ANSI37 (defun c:c_ansi37 () (setq *error* myerror) (if scale (setq sc1 (rtos scale 2 2)) (setq sc1 "")) (setq sc1 (getdist (strcat " input scale <" sc1 ">: "))) (if sc1 (setq scale sc1)) (setvar "cmdecho" 0) (c_inset) (layerht) (setvar "hpname" "ansi37") (setvar "hpdouble" 1) (setvar "hpspace" (* 2 scale)) (setvar "hpscale" (* 2 scale)) (setvar "hpang" 0) (princ " Select area to hatch") (command "-bhatch" pause "") (setvar "cmdecho" 1) (c_outset) (princ) ) ;;;ANSI31 (defun c:c_ansi31 () (setq *error* myerror) (if scale (setq sc1 (rtos scale 2 2)) (setq sc1 "")) (setq sc1 (getdist (strcat " input scale <" sc1 ">: "))) (if sc1 (setq scale sc1)) (setvar "cmdecho" 0) (c_inset) (layerht) (setvar "hpname" "ansi31") (setvar "hpdouble" 0) (setvar "hpspace" (* 2 scale)) (setvar "hpscale" (* 2 scale)) (setvar "hpang" 0) (princ " Select area to hatch") (command "-bhatch" pause "") (setvar "cmdecho" 1) (c_outset) (princ) ) ;;; BRICKWORK (defun c:c_brkw () (setq *error* myerror) (if scale (setq sc1 (rtos scale 2 2)) (setq sc1 "")) (setq sc1 (getdist (strcat " input scale <" sc1 ">: "))) (if sc1 (setq scale sc1)) (setvar "cmdecho" 0) (c_inset) (layerht) (setvar "hpname" "masonry") (setvar "hpdouble" 0) (setvar "hpspace" (* 18.75 scale)) (setvar "hpscale" (* 18.75 scale)) (setvar "hpang" 0) (princ " Select area to hatch") (command "-bhatch" pause "") (setvar "cmdecho" 1) (c_outset) (princ) ) ;;;Control Hatch Layer ;;; (defun c:HO () (setq *error* myerror) (setvar "cmdecho" 0) (if(not h_on)(setq h_on 1)) (if(= h_on 1) (progn (setq askwhich (strcase (getstring " Hatch layer, Freeze or Off:<O>?"))) (progn (if(= askwhich "F") (command "_.layer" "_f" "HATCh" "") (command "_.layer" "_off" "HATCh" "")) ) (setq h_on 0) ) (progn (command "_.layer" "_on" "HATCh" "") (command "_.layer" "_t" "HATCh" "") (setq h_on 1) ) ) (setvar "cmdecho" 1) (princ) ) ;;; (defun c:MHATCH () (setq *error* myerror) (c_inset) (setvar "osmode" 0) (command "layer" "m" cur_hatclayer "") (setvar "cecolor" cur_hatccolor) (setvar "celtype" cur_hatcltype) (setq morehatc 1) (while morehatc (setq morehatc nil) (initget 128 "None") (setq hpt (getpoint " Enter/<Internal point>:")) (if(/= hpt None) (progn (command "-bhatch" hpt "") (setq morehatc 1) ) ) (setq hpt nil) ) (c_outset) (princ) ) ;;; (defun c:LO () (setvar "cmdecho" 0) (if(not lb_on)(setq lb_on 1)) (if(= lb_on 1) (progn (setq askwhich (strcase (getstring " Hatch layer, Freeze or Off:<O>?"))) (progn (if(= askwhich "F") (command "_.layer" "_f" "HATCH" "") (command "_.layer" "_off" "HATCH_LB" "")) ) (setq lb_on 0) ) (progn (command "_.layer" "_on" "S-HATC-LB" "") (command "_.layer" "_t" "S-HATC-LB" "") (setq lb_on 1) ) ) (setvar "cmdecho" 1) (princ) ) ;;; (defun c:smh2 () (princ " Warning: Ensure That Areas to be Hatched are Closed Polylines and that ") (princ "Hatch Entity Properties are set! ") (setq ss (ssget) sl (sslength ss) index 0 ) (repeat sl (setq en (ssname ss index)) (setq el (entget en)) (setq as (assoc 0 el)) (setq index (+ 1 index)) (if (= "LWPOLYLINE" (cdr as)) (command "-bhatch" "s" en "" "") ) ) )