Automated hatching

Discussion in 'AutoCAD' started by colin1234, Oct 4, 2004.

  1. colin1234

    colin1234 Guest

    Can anyone help me with regard to this. I want to be able to point the mouse within a boundary and have that selected as an area for solid hatching. Also i want it to be the points selected are individual solid hatches.

    Thanks for your help

    Colin
     
    colin1234, Oct 4, 2004
    #1
  2. colin1234

    Holly Guest

    This code was taken from somewhere else on this forum.
    I forget where, when and who. Apologies to the author.
    Works fine for me.
    From command line type - mhatchsolid

    HOLLY x

    ;;;--------------------------------------
    (defun SSHatch (ent1)
    (command "_.bhatch" "a" "a" "y" "" "p" "solid" "s" ent1 "" "")
    )
    (defun SelSetPro (sset dowhat / ssent)
    (while (/= (sslength sset) 0)
    (setq ssent (ssname sset 0))
    (dowhat ssent)
    (ssdel ssent sset)
    )
    )

    (defun c:mhatchsolid (/ ss)
    (command "_.undo" "_end")
    (command "_.undo" "_group")
    (prompt "\nSelect areas to hatch")
    (setq ss (ssget))
    (SelSetPro ss SSHatch)
    (command "_.unod" "_end")
    )
    ;;;----------------------------------------
     
    Holly, Oct 4, 2004
    #2
  3. colin1234

    colin1234 Guest

    Thanks Holly will give it a try

    Colin
     
    colin1234, Oct 4, 2004
    #3
  4. colin1234

    vk540 Guest

    Command worked good after I changed unod to undo.
     
    vk540, Oct 4, 2004
    #4
  5. colin1234

    Adesu Guest

    Hi colin1234, maybe I help you,try this

    ; mh is stand for making hatch
    ; Design by Ade Suharna <>
    ; 5 October 2004
    ; Program no.101/10/2004
    (defun c:mh ()
    (while
    (setq ent (getpoint "\nCLICK OBJECT FOR HATCH: "))
    (setq inp1 (getstring "\nENTER NEW NAME OF HATCH PATTERN: "))
    (setq inp2 (getreal "\nENTER NEW SCALE OF HATCH: "))
    (setq inp3 (getreal "\nENTER NEW ANGLE OF HATCH: "))
    (command "_bhatch" "p" inp1 inp2 inp3 ent "")
    )
    )
     
    Adesu, Oct 5, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.