..::Change hatch to solid::..

Discussion in 'AutoCAD' started by Holly, Oct 22, 2004.

  1. Holly

    Holly Guest

    Hi guys,
    I'm looking for a routine to change all hatch elements in a drawing to SOLID hatch (note hatch not solid "entity").
    I am sure I have used LT in the past with this command, and thought it was on Express Tools for Acad. But can't find it.

    Have tried using the properties box, but for some reason, some of the hatched areas throw up problems when selected as ALL, but work ok as individuals.

    Can anyone help?
    Thanks,
    HOLLY x
     
    Holly, Oct 22, 2004
    #1
  2. So it should be solid but no solid!
    Weird.
    Try putting the scale factor to 0 (zero).

    Jan

    SOLID hatch (note hatch not solid "entity").
    on Express Tools for Acad. But can't find it.
    hatched areas throw up problems when selected as ALL, but work ok as
    individuals.
     
    Jan van de Poel, Oct 22, 2004
    #2
  3. Holly

    Holly Guest

    Thanks Jan, but not really the solution. I know what you mean, but that makes the drawing too slow by far.

    I have a drawing with loads of hatching (and I do mean loads!).
    Hatch pattern is currently DOTS.
    I now want to convert the "DOTS pattern" to "SOLID pattern".

    I think I'm right in presuming that the "hatch" created by the SOLID command is not the same as the solid hatch pattern?

    Like I said previously, I am getting errors when I select all with properties bar (even when I filter out non hatch elements). Thought that lisp might do the trick, but don't know where to start.

    Many thanks,
    HOLLY
     
    Holly, Oct 22, 2004
    #3
  4. Holly

    Jürg Menzi Guest

    Hi Holly

    Try this one:
    Code:
    (defun C:ChangeHatchPattern ( / AcaDoc CurEnt CurObj CurSet)
    (vl-load-com)
    (setq AcaDoc (vla-get-ActiveDocument (vlax-get-acad-object)))
    (vla-StartUndoMark AcaDoc)
    (if (setq CurSet (ssget "X" '((0 . "HATCH") (2 . "DOTS"))))
    (while (setq CurEnt (ssname CurSet 0))
    (setq CurObj (vlax-ename->vla-object CurEnt))
    (vla-SetPattern CurObj acHatchPatternTypePreDefined "SOLID")
    (ssdel CurEnt CurSet)
    )
    )
    (vla-EndUndoMark AcaDoc)
    (princ)
    )
    
    Cheers
     
    Jürg Menzi, Oct 22, 2004
    #4
  5. Holly

    Tom Smith Guest

    I am getting errors when I select all with properties bar

    I don't have any problem using qselect to select all hatches with a certain
    pattern name, then properties to change them to a different pattern.
     
    Tom Smith, Oct 22, 2004
    #5
  6. Holly

    Dave Jones Guest

    what's wrong with HATCHEDIT?
    Dave
    DDP
    makes the drawing too slow by far.
    command is not the same as the solid hatch pattern?
    properties bar (even when I filter out non hatch elements). Thought that
    lisp might do the trick, but don't know where to start.
     
    Dave Jones, Oct 22, 2004
    #6
  7. Holly

    Holly Guest

    Thanks Jurg, just the ticket!
    Can this be modified to make any hatch solid, not just dots?
    Not sure about all this VL stuff :eek:)
    Just curious as it could be handy in future.

    Tom and Dave - thanks for the input, but had tried both those methods, but for some unknown reason I was getting errors saying "Ambiguous Error" and then Acad undoing several parts of work!! This error was coming up during multiple selection, but not on any individual selections.

    HOLLY x
     
    Holly, Oct 22, 2004
    #7
  8. Holly

    Tom Smith Guest

    what's wrong with HATCHEDIT?

    Single object selection souunds like it would be very tedious for her.
     
    Tom Smith, Oct 22, 2004
    #8
  9. Holly

    Jürg Menzi Guest

    Hi Holly

    Welcome...¦-)
    Sure, change the line:
    (if (setq CurSet (ssget "X" '((0 . "HATCH") (2 . "DOTS"))))
    to
    (if (setq CurSet (ssget "X" '((0 . "HATCH"))))
    that's all...

    Cheers
     
    Jürg Menzi, Oct 22, 2004
    #9
  10. Holly

    Holly Guest

    Thank you kindly!

    HOLLY x
     
    Holly, Oct 22, 2004
    #10
  11. Holly

    Dave Jones Guest

    I didn't realize until today that you couldn't HATCHEDIT/ALL, so your point
    is well taken
    Dave
     
    Dave Jones, Oct 22, 2004
    #11
  12. Holly

    Tom Smith Guest

    I didn't realize until today that you couldn't HATCHEDIT/ALL, so your
    point is well taken

    Oddly enough, though, it will work with a selection set, like this (posted
    by BillZ on 10/11/04):

    (defun Hatch_change (/ ss)
    (while
    (setq ss (ssget "X" '((0 . "HATCH")(2 . "SOLID"))))
    (command "hatchedit" ss "P" "ansi37" "0.5" "")))

    At first glance, I thought this was illegal, but it runs. I forgot about
    this post till now, but it might have answered Holly's situation. Haven't
    had a chance to ponder this anomoly.
     
    Tom Smith, Oct 22, 2004
    #12
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.