For example, at equal X and Y, and assuming closed objects that you will select, in fairly simple terms:
(defun C:GPEXY ; = Grid of Points at Equal X & Y spacings
(/ ss n ent pt)
(setvar 'hporiginmode 5); origin at center of bounding box
(setvar 'hpname "DOTS-SQ")
(setvar 'pdmode 33); open circles
(setvar 'pdsize -2); 2% of viewport size
(command-s "_.HATCH" "" pause "")
(command "_.explode" (entlast))
(setq ss (ssget "_P")); the resulting Lines
(repeat (setq n (sslength ss))
(setq ent (ssname ss (setq n (1- n))))
(command "_.point" "_non" (setq pt (cdr (assoc 10 (entget ent)))))
(entdel ent)
(setq ptlist (cons pt ptlist))
); repeat
(prin1)
)
It requires you to have that DOTS-SQ pattern available, and asks for the spacing within the Hatch command. It could ask for that in advance instead, could have Layer control, and other things.
It leaves the list of locations as points in the 'ptlist' variable, which is not localized so it survives after the command.
Read about the System Variables it sets, and edit accordingly. Maybe you want it to allow you to change the origin [and/or rotation?] before Exploding, and other refinements are possible, such as confirming that you picked closed object(s), or allowing picking in areas instead of selecting objects, etc.
Kent Cooper, AIA