A lisp to split up a hatch made of multiple patches
(defun c:sph ()
(setq hh (car(entsel "\nSelect a hatch"))) ;select a hatch
(if (/= (cdr(assoc 0 (entget hh))) "HATCH") ; first check to see if hatch was selected
(progn
(alert "SORRY THAT IS NOT A HATCH")
(exit) ;exit function if not a hatch
)
)
(setq oldhatch (cdr (assoc -1 (entget hh)))) ; gets the entity id of the selected hatc for deletion later
(command "layer" "M" "TempHatchBoundary" "c" "red" "" "") ; create a new layer for temp boundary
(command "hatchgenerateboundary" hh "") ;genertate new boundaries from hatch
(command "layer" "M" "NEW_HATCH" "c" "green" "" "") ;create new layer for new hatch
(setq ss (ssget "X" '((0 . "LWPOLYLINE") (8 . "TempHatchBoundary"))))
(foreach pp (vle-selectionset->list ss)
(setq bent (cdr (assoc -1 (entget pp )))) ;"bent" is variabel "boundary entity"
(command "hatch" "s" bent "" "")
(command "chprop" bent "" "LA" "NEW_HATCH" "") ;change new boundary to hatch layer
)
(command "delete" oldhatch "")
)
Here is a lisp to take a hatch that is not continuous and break it up into separate hatch areas. Comments and improvements welcome.
0