rcb007 Posted December 7, 2022 Posted December 7, 2022 I found this routine which would allow you to select a block with whatever measurements. Then pick a point and fill a closed polyline area. So far it works with the first picture below. I was wondering how i could make it fill the whole area in a uniform grid to that of the second picture. Thank you for any guidance on it. (defun c:adray (/ ent blk ss rowdist colmdist point0) ;;https://forums.augi.com/showthread.php?163443-Create-array-within-a-boundary (setq rowdist (getdist "\n Y Distance of Block :")) (setq colmdist (getdist "\n X Distance of Block :")) (cond ((and (setq ent (car (entsel "\nSelect the Measured Block Entity: "))) (eq (cdr (assoc 0 (entget ent))) "INSERT") (setq blk (vla-get-effectivename (vlax-ename->vla-object ent))) ))) (setq lyr "LAYOUT") (command "Layer" "M" lyr "C" "green" "" "") (command "-Hatch" (getpoint "\nPick a point inside closed polyline: ") "P" "U" "0.0" rowdist "N" "") (command "Explode" (entlast)) (setq ss (ssget "X" (list '(0 . "LINE") (cons 8 lyr) ) ) num (sslength ss) i -1 ) (repeat num (setq ent (ssname ss (setq i (1+ i)))) (command "measure" ent "B" blk "Y" colmdist) (entdel ent) ) (princ) ) (C:adray) Quote
mhupp Posted December 7, 2022 Posted December 7, 2022 I posted something like this this year or last. cant find it right now but 'll look when i get home. basically you want to just have a grid of blocks that cover the whole polyline. Then use ssget with "CP" and polycords to select any block that is crossing. and delete the rest. Quote
rcb007 Posted December 7, 2022 Author Posted December 7, 2022 That sound about right, the only other thing i could think of, is to always keep the orientation left and right and create an angle from that. Again thank you! Quote
BIGAL Posted December 7, 2022 Posted December 7, 2022 (edited) Did this for something else, pick say pline, then get boundingbox overfill the pline with the grid boxes using array, then do a ssget wp this gets all grids that touch and within put on dummy layer and turn off, erase grids that are on, turn back on dummy layer and change layer of grids. You need a grid starting point at say a true co-ord ie in grid spacing 10x20 do this by rounding down the lower left corner to a grid space value. This is how I remember doing this like 20 years ago not tested. Edited December 7, 2022 by BIGAL Quote
rcb007 Posted December 8, 2022 Author Posted December 8, 2022 I stumbled upon superhatch, which seems to give me exactly what I needed. Just wanted to let you know. Again, thanks for the help. 1 Quote
mhupp Posted December 8, 2022 Posted December 8, 2022 (edited) Sorry forgot to post this. -Edit little edit so it selects all the blocks inside and crossing polyline ;;----------------------------------------------------------------------;; ;;HIGLIGHT BLOCKS THAT CROSS POLYLINE (defun C:PCross (/ SS SS1 SS2 coords) (if (setq SS (ssget "_+.:E:S" '((0 . "*POLYLINE")))) (progn (setq coords (vl-remove-if 'not (mapcar (function (lambda (p) (if (= 10 (car p)) (cdr p)))) (entget (ssname SS 0))))) (if (setq SS1 (ssget "_CP" coords '((0 . "INSERT")))) (sssetfirst nil SS1) ) ) ) (princ) ) Edited December 8, 2022 by mhupp Quote
rcb007 Posted December 8, 2022 Author Posted December 8, 2022 Thanks for sharing this! Appreciate it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.