;;;Place a standard Plan Grid array beginning at the point you specify ;;; and terminating at the north and east ;;; distances you specify. The grid will be divided into 100', 500' ;;; and 1000'grid lines on separate layers so that you can easily ;;; change between display of these intervals without editing the grid. ;;; ;;; ;;; ;;;> Author: Henry C. Francis ;;;> 425 N. Ashe St. ;;;> Southern Pines, NC 28387 ;;;> http://paracadd.com ;;;> All rights reserved. ;;; ;;;> COPYRIGHT: 5-31-94 ;;;> EDITED: 06-15-1999 ;;; (DEFUN c:pgl (/) (c:egrid) (SETQ pt1 (upoint 0 "" "\nOrigin of Grid (nearest 1000 index)" nil nil)) (setq init_ecoor (*(fix(/(car pt1)1000))1000) ecoor init_ecoor) (setq init_ncoor (*(fix(/(cadr pt1)1000))1000) ncoor init_ncoor) (SETQ esiz (ureal 1 "" "\nEasting Range (in feet)" (if esiz esiz 1000))) (setq cur_ecoor init_ecoor) (SETQ nsiz (ureal 1 "" "\nNorthing Range (in feet)" (if nsiz nsiz 1000))) (setq cur_ncoor init_ncoor) (WHILE (<= cur_ecoor (+ init_ecoor esiz)) (entmake (list (cons 0 "LINE") (cons 62 256) (cond ;((=(- cur_ecoor ecoor)0) ; (cons 8 "C-GRIDF1000")) ((=(rem(- cur_ecoor ecoor) 1000)0) (cons 8 "C-GRIDF1000")) ((=(rem(- cur_ecoor ecoor) 500)0) (cons 8 "C-GRIDE0500")) ((=(rem(- cur_ecoor ecoor) 200)0) (cons 8 "C-GRIDD0200")) ((=(rem(- cur_ecoor ecoor) 100)0) (cons 8 "C-GRIDD0100")) ) (cons 10 (list cur_ecoor cur_ncoor 0)) (cons 11 (list cur_ecoor (+ cur_ncoor nsiz) 0)) ) ) (setq cur_ecoor (+ 100 cur_ecoor)) ) (WHILE (<= cur_ncoor (+ init_ncoor nsiz)) (entmake (list (cons 0 "LINE") (cons 62 256) (cond ((=(rem(- cur_ncoor ncoor) 1000)0) (cons 8 "C-GRIDF1000")) ((=(rem(- cur_ncoor ncoor) 500)0) (cons 8 "C-GRIDE0500")) ((=(rem(- cur_ncoor ncoor) 200)0) (cons 8 "C-GRIDD0200")) ((=(rem(- cur_ncoor ncoor) 100)0) (cons 8 "C-GRIDD0100")) ) (cons 10 (list init_ecoor cur_ncoor 0)) (cons 11 (list (+ init_ecoor esiz) cur_ncoor 0)) ) ) (setq cur_ncoor (+ 100 cur_ncoor)) ) (command ".layer" "c" 13 "C-GRIDD0100" "") (command ".layer" "c" 13 "C-GRIDD0200" "") (command ".layer" "c" 14 "C-GRIDE0500" "") (command ".layer" "c" 15 "C-GRIDF1000" "") ) (defun c:egrid (/) (command ".erase" (ssget "x" '((8 . "c-grid?##00"))) "") ) (defun c:100grid (/) (command ".layer" "on" "*c-grid?##00" "") ) (defun c:200grid (/) (command ".layer" "on" "*c-grid?##00" "off" "*gridd0100,*gride0500" "" "") ) (defun c:500grid (/) (command ".layer" "on" "*c-grid?##00" "off" "*gridd0100,*gridd0200" "" "") ) (defun c:1000grid (/) (command ".layer" "on" "*c-grid?##00" "off" "*gridd0100,*gridd0200,*gride0500" "" "") ) (princ) ;|«Visual LISP© Format Options» (72 2 40 2 T "end of " 60 9 2 0 0 T T nil T) ***Don't add text below the comment!***|;