Search code examples
lispautocadautolisp

How to create lisp for AutoCAD that will allow you to place hatches on top of already created ones, and without intersections?


Is it possible to create lisp code for AutoCAD that will allow us to place a hatch on top of another? In AutoCAD, when two or more hatches are placed in one area, they all intersect with each other, creating some kind of incomprehensible mess.

It would be interesting and useful to create a lisp that allows you to place hatches on top of each other, so that the first hatch does not appear inside the second hatch, but appears under it. If you have any ideas on how to implement this, please answer me.

The picture shows an example of how hatching works now and what result I want to get:

enter image description here


Solution

  • As far as I know it may not be possible. But I have some workaround. First and the most important question You have to answar is: Do You have to do it by LISP, or maybe result by just few clicks is acceptable. To have it by clicks You shoud:

    1. Create the shape of segment which must overlay others as polyline.
    2. Create a wipeout based of shape ( like a drop on Your example )
    3. Create block containing wipeout
    4. Use command SUPERCHATCH to fill Your area by block.
    5. commad DrawOrder helps You to set superhatch topmost.

    In fact points 1-3,5 You can do by LISP, but the problem starts with using SuperHatch by lisp. I'm using ZWCAD where SuperHatch is not avaliable in dialogless mode. I can't test on AutoCAD. Also creating superhatch by LISP may be complicated and maybe not necessary if using few commands wouldb be acceptable.