@apelbaum2014 wrote:
I have a drawing with many "holes"(circles) in hatch and now I need to move all circles in a different places. After moving i have a boundaries remains in a hatch..
to remove it i use this little lisp:
(defun C:HR(/ gp) (setq gp (ssget))(command "-hatchedit" gp "r" ));remove boundary from hatch
but I have a problem when I need to select boundaries one by one..
Is it possible to select ALL boundaries in a one click in order to remove it?
Any help will be very appretiated
Hi apelbaum2014!
This is quick and dirty, and minimally tested, but it may get you started, and it will fail if outer boundary is also a CIRCLE.
I have a deadline to meet, so at the moment, I don't have much free time...
(vl-load-com)
(defun c:MHR (/ cen circle circles ent hnd i rad ss)
(cond ((setq ss (ssget "_X" (list '(0 . "HATCH") (cons 410 (getvar 'ctab)))))
(command "_.undo" "_G" "_.zoom" "_O" ss "")
(repeat (setq i (sslength ss))
(setq hnd (ssname ss (setq i (1- i)))
ent (entget hnd)
circles (vl-remove-if-not
'(lambda (a)
(and (= (car a) 330)
(= (cdr (assoc 0 (entget (cdr a)))) "CIRCLE")
)
)
ent
)
)
(cond (circles
(command "-hatchedit" hnd "r")
(foreach x circles
(setq circle (entget (cdr x))
cen (cdr (assoc 10 circle))
rad (cdr (assoc 40 circle))
)
(command (list (+ rad (car cen)) (cadr cen)))
)
(command "")
)
)
)
(command "_.zoom" "_P" "_.undo" "_E")
)
(T
(prompt "\Could not find any hatches... ")
)
)
(princ)
) ;remove circle boundaries from hatch
Hope this helps,
Henrique