Lisp to turn on/off hatch patterns...

Discussion in 'AutoCAD' started by Mike Weaver, Mar 2, 2004.

  1. Mike Weaver

    Mike Weaver Guest

    It's easy to turn off the layer a hatch is on, beyond that it gets a bit
    more interesting - there is no on/off property for hatch objects, though
    there is a visibility property. While individual objects can be set
    invisible, you won't then be able to select them to make them visible. Take
    a look at the code for Poof.lsp (customer files, 2/18/2004) for examples of
    using this property.

    Mike Weaver
     
    Mike Weaver, Mar 2, 2004
    #1
  2. Can anybody share a routine to quickly turn on/off hatch patterns?
     
    Craig Vaughn AIA CSI, Mar 2, 2004
    #2
  3. FillMode=0, Regen

    FillMode=1, Regen

    --
    R. Robert Bell, MCSE
    www.AcadX.com


    Can anybody share a routine to quickly turn on/off hatch patterns?
     
    R. Robert Bell, Mar 2, 2004
    #3
  4. Mike Weaver

    Mike Weaver Guest

    Good one. I thought fillmode was for solid fills only.

    Mike
     
    Mike Weaver, Mar 2, 2004
    #4
  5. Thanks, Robert. That was *exactly* what I needed.

    Regenall for paperspace, though...

    Craig
     
    Craig Vaughn AIA CSI, Mar 2, 2004
    #5
  6. Happy to help (and good point about regenall, for the lurkers.)

    --
    R. Robert Bell, MCSE
    www.AcadX.com


    Thanks, Robert. That was *exactly* what I needed.

    Regenall for paperspace, though...

    Craig
     
    R. Robert Bell, Mar 2, 2004
    #6
  7. Thanks
     
    R. Robert Bell, Mar 2, 2004
    #7
  8. Mike Weaver

    OLD-CADaver Guest

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (defun c:HATCHTOGGLEDISPLAY ( / a b c d e)
    (setq
    a (ssget "x" (list (cons 0 "hatch"))) ; select all hatches
    b (sslength a)
    c 0.0
    ht (IF ( = ht 0 ) 1 0)
    ) ;_ end of setq
    (while (setq d (ssname a c))
    (setq
    e (entget d)
    e (append e (list (cons 60 ht))) ; change the group 60
    ) ; end of setq
    (entmod e) ; modify the entities
    (setq c (1+ c))
    ); end while
    ) ; end of function
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
     
    OLD-CADaver, Mar 2, 2004
    #8
  9. Mike Weaver

    Doug Broad Guest

    LOL. Robert, apparently that has
    been around since at least R14 and
    I had overlooked that use for it.
    Thanks for the lesson!!
     
    Doug Broad, Mar 2, 2004
    #9
  10. Scary, isn't it. There is so much in there that it is getting difficult to
    keep track of all the possibilities!

    --
    R. Robert Bell, MCSE
    www.AcadX.com


    LOL. Robert, apparently that has
    been around since at least R14 and
    I had overlooked that use for it.
    Thanks for the lesson!!
     
    R. Robert Bell, Mar 2, 2004
    #10
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.