Hi guys,
I would like to be able to go into a drawing and delete all solid hatches from all layers. Is this possible? Thank you kindly. 🙂
Kameron
Solved! Go to Solution.
Solved by kameron1967. Go to Solution.
Solved by Lee_Mac. Go to Solution.
Do you also have other Insertions of the same Block(s), without the white color override [whether with no color override or with a different color] that contain the same Hatch objects? If that's the case, you can't remove the Hatch from the Block definitions. You may need to Explode all those Blocks and then delete the Hatches.
What do you enter in the Command Prompt to execute this .LISP? I loaded it, but don't know how to execute it?
Corey Barge
@Anonymous wrote:
.... all solid white hatches, in different shape and size, within different blocks shall be cleaned out. Boundaries should stay.
Try this addition to the code in Post 2:
....
(if (and (= "AcDbHatch" (vla-get-objectname o)) (= "SOLID" (strcase (vla-get-patternname o))) (= 7 (vla-get-Color o))
(vlax-write-enabled-p o) ) (vla-delete o) )
....
The lisp routine does not work in AutoCAD 2018.
@Lee_Mac wrote:
The following will delete all solid hatches from all layouts and from within blocks & nested blocks (nested to any level):
(defun c:delsolhat ( / d ) (vlax-for b (vla-get-blocks (setq d (vla-get-activedocument (vlax-get-acad-object)))) (if (= :vlax-false (vla-get-isxref b)) (vlax-for o b (if (and (= "AcDbHatch" (vla-get-objectname o)) (= "SOLID" (strcase (vla-get-patternname o))) (vlax-write-enabled-p o) ) (vla-delete o) ) ) ) ) (vla-regen d acallviewports) (princ) ) (vl-load-com) (princ)
The lisp routine does not work in AutoCAD 2018.
It works fine in 2018 and 2019 for me.
I reinstalled AutoCAD 2018 and now it works.
That was much easier than going into the registry.
Thank you. Awesome LISP routine. Architects use Revit and they always export CAD files with solid hatching. I love deleting all of the solid.
Anything from 2024. Can't get rid of all "Fill" on a supplied drawing. Can't turn fill off as my own blocks use a fill. Turn off Fill ad then Xref the fill is back showing again.
Can't find what you're looking for? Ask the community or share your knowledge.