Raster Autocad 2021 May 2026

;; --- User Input --- (princ "\nSpecify first corner of raster area: ") (setq p1 (getpoint "\nPick first corner: ")) (if (null p1) (exit)) (setq p2 (getcorner p1 "\nSpecify opposite corner: ")) (if (null p2) (exit))

(command "_.UNDO" "_END") (setvar "cmdecho" 1) (princ) ) raster autocad

;; Calculate spacing (setq x-spacing (/ width (1- cols))) (setq y-spacing (/ height (1- rows))) ;; --- User Input --- (princ "\nSpecify first

;; Loop through rows (Y direction) and columns (X direction) (setq i 0) ; row index (while (< i rows) (setq y-pos (+ (cadr p1) (* i y-spacing))) (setq j 0) ; col index (while (< j cols) (setq x-pos (+ (car p1) (* j x-spacing))) ;; Create point at (x-pos, y-pos, elevation z from p1) (setq point-obj (command "_.POINT" (list x-pos y-pos (caddr p1)))) (setq j (1+ j)) ) (setq i (1+ i)) ) row index (while (&lt

;; Check if spacing is too small (if (or (< x-spacing 0.001) (< y-spacing 0.001)) (progn (princ "\nError: Spacing too small. Increase grid size or reduce rows/columns.") (exit) ) )

;;; RASTER.LSP ;;; Generates a raster grid of points (or 3D faces) in AutoCAD. ;;; Command: RASTERGRID ;;; Author: AI Assistant ;;; Description: Creates a rectangular grid of points based on user inputs ;;; for origin, width, height, and row/column counts.