See the top rated post in this thread. Click here

Results 1 to 9 of 9

Thread: Find all solid hatch and delete/change lisp

  1. #1
    Active Member terryh's Avatar
    Join Date
    2006-01
    Location
    Melbourne, Australia
    Posts
    51
    Login to Give a bone
    0

    Default Find all solid hatch and delete/change lisp

    I need a lisp that will find all solid hatch in a drawing and change them all to a layer called HATCH_SOLID, colour BYLAYER (this layer having colour set to 40 with 30% screening) and send-to-back draworder.

    This is because when I receive drawings from external offices where they have used soild hatch, but haven't sent the ctb file, rather than waiting for them to send me their ctb file, I find the quickest way to print them with my monochrome settings and have colour 40 as 30% screening.

    I'm using AutoCAD so a lisp will do, but is there an alternative solution for my LT using staff?

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658
    Login to Give a bone
    0

    Default Re: Find all solid hatch and delete/change lisp

    Quick Select => Hatch => Pattern name => =Equals => _SOLID
    Should work for selecting them for both of you I think. Not that familar with LT. Use Properties Palette for layer and color then use draworder.

  3. #3
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Find all solid hatch and delete/change lisp

    For Lisp you could use something like this:
    Code:
    (defun c:SH-Layer (/ ss )
      (if (not (tblsearch "LAYER" "HATCH_SOLID"))
        (command "._LAYER" "_Make" "HATCH_SOLID" "_Color" "40" "HATCH_SOLID" "_TRansparency" "30" "HATCH_SOLID" "")
      )
      (if (setq ss (ssget "_X" '((0 . "HATCH") (2 . "SOLID"))))
        (command "._CHANGE" ss "" "_Properties" "_LAyer" "HATCH_SOLID" "_Color" "ByLayer" "")
      )
      (princ)
    )

  4. #4
    Active Member terryh's Avatar
    Join Date
    2006-01
    Location
    Melbourne, Australia
    Posts
    51
    Login to Give a bone
    0

    Default Re: Find all solid hatch and delete/change lisp

    Thanks irneb. That's almost perfect. I need the hatch the be 'sent to back' in the draworder. Can you add this command in then it's exactly what I need. Thanks for your help.

    Tom, I had been using your way 'qselect' and it's the only way the LT users can do it. I thought there must be a lisp solution, but I don't know it well engough. That's the beauty of these forums.

    Thanks guys.

  5. #5
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Find all solid hatch and delete/change lisp

    That's a reasonably simple addition. Changes marked in red:
    Code:
    (defun c:SH-Layer (/ ss )
      (if (not (tblsearch "LAYER" "HATCH_SOLID"))
        (command "._LAYER" "_Make" "HATCH_SOLID" "_Color" "40" "HATCH_SOLID" "_TRansparency" "30" "HATCH_SOLID" "")
      )
      (if (setq ss (ssget "_X" '((0 . "HATCH") (2 . "SOLID"))))
        (progn
          (command "._CHANGE" ss "" "_Properties" "_LAyer" "HATCH_SOLID" "_Color" "ByLayer" "")
          (command "._DRAWORDER" ss "" "_Back")
        )
      )
      (princ)
    )
    BTW, if you don't want to see the commands running then the function becomes a bit more complex ... needing to set and reset the CmdEcho system variable, perhaps even doing some error management (though this is usually only necessary if there's user interaction).

    There's a lot this "simple" function won't do though. What about these hatches inside of blocks? I've got something similar for my wipeouts: http://forums.augi.com/showthread.php?t=130229

    It shouldn't be too difficult to have that work on hatches and changing their layer as well.

  6. #6
    Active Member terryh's Avatar
    Join Date
    2006-01
    Location
    Melbourne, Australia
    Posts
    51
    Login to Give a bone
    0

    Default Re: Find all solid hatch and delete/change lisp

    That's got it. Brilliant. That'll save me time.

  7. #7
    Member
    Join Date
    2012-11
    Posts
    11
    Login to Give a bone
    0

    Default Re: Find all solid hatch and delete/change lisp

    do you have a version of this that gets to the hatches inside blocks as well...? that would be amazing!

  8. #8
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    1

    Default Re: Find all solid hatch and delete/change lisp

    Quote Originally Posted by gbrl.frdmn344420 View Post
    do you have a version of this that gets to the hatches inside blocks as well...? that would be amazing!
    Yes, as I've stated in my previous post - the one in this thread works on wipeouts inside blocks. It would be simple to do the same for Hatches - change the AcDbWipeout to AcDbHatch.

  9. #9
    Woo! Hoo! my 1st post
    Join Date
    2013-06
    Posts
    1
    Login to Give a bone
    0

    Default Re: Find all solid hatch and delete/change lisp

    Hi! I'm using AutoCAD 2012 (Hungarian), with drawings that usually contains at least 100 blocks with hatches. I've tried the LISP you made, changed the wipeout to hatch and with "(vl-load-com)" it worked well. It moved the wipeouts to the bottom... So if it's really not that much time for you to modify the command, would you please make a version for me?
    It needs to find only the solid hatches, only in blocks and move them to a new layer (for example HATCH_SOLID2, color 41). If it only erases them, that will also do the job.
    Thank you for your time!

Similar Threads

  1. find and delete imported CAD plan
    By stephan.gilges in forum Revit - Platform
    Replies: 13
    Last Post: 2017-05-10, 04:24 AM
  2. Replies: 4
    Last Post: 2013-01-06, 07:00 PM
  3. Replies: 5
    Last Post: 2008-03-16, 07:00 AM
  4. Is there a way I can list a 3d solid to find its volume?
    By kwong in forum AutoCAD 3D (2007 and above)
    Replies: 2
    Last Post: 2007-02-21, 01:28 PM
  5. Importing Autocad Fill (Solid or Solid Hatch)
    By Jit in forum Revit Architecture - General
    Replies: 2
    Last Post: 2004-04-20, 12:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •