TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: w64bit on July 01, 2017, 06:39:53 AM
-
I am trying to disassociate all hatches in model with:
(if (setq hatch (ssget "_X" '((0 . "HATCH") (410 . "Model"))))(command "_HATCHEDIT" hatch "" "_DI"))
but it doesn't work.
Can anyone give me a hint to fix it?
Thank you.
-
Try the following:
(defun c:dehatch
( / sel qaf
) (if (setq sel
(ssget "_X" '
((0 .
"HATCH") (410 .
"Model")))) (vl-cmdf "_.-hatchedit" sel
"" "_DI") )
)
)
-
If I want to put it in a SCR file and to make it simpler, is it OK like this?
(if (setq sel (ssget "_X" '((0 . "HATCH") (410 . "Model"))))
(progn
(setvar 'qaflags 1)
(vl-cmdf "_.-hatchedit" sel "" "_DI")
(setvar 'qaflags 0)))
-
A simpler version for SCR file.
QAFLAGS 1
(if (setq sel (ssget "_X" '((0 . "HATCH") (410 . "Model"))))(command "_.-HATCHEDIT" sel "" "_DI"))
QAFLAGS 0
Thank you very much, Lee.
-
Save it as dehatch.lsp to an AutoCAD Support Path, then, in your Script:
(or (boundp 'c:dehatch) (load "dehatch.lsp" nil)) (if (boundp 'c:dehatch) (c:dehatch))