Results 1 to 7 of 7

Thread: Erase outside the Box

  1. #1
    Member
    Join Date
    2006-02
    Location
    SLC
    Posts
    35
    Login to Give a bone
    0

    Default Erase outside the Box

    I am trying to erase everything left outside a closed shape and I can't figure out how to create the selection set. If anyone has some help in how to create a selection of the remaining stuff left behind so I can erase it, it would be greatly appreciated.

    Thanks
    Brian

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,100
    Login to Give a bone
    0

    Default Re: Erase outside the Box

    Are you incorporating this into another routine?

    The Express Tools has the Cookie Cutter Trim command (EXTRIM).
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Erase outside the Box

    A round about way, select everything with (ssget "x") and then select a second time with the corrdinates from your shape, and then remove the second selection set from the first, and then erase the first.

  4. #4
    Member
    Join Date
    2006-02
    Location
    SLC
    Posts
    35
    Login to Give a bone
    0

    Default Re: Erase outside the Box

    I guess I failed to note that I need to do it within LISP. I have used the ssget "x" to remove and filter others but how do I make a separation between inside the box and outside the box? I have used boundary to establish the perimeter that I need and used similar code to extrim in express to cut the edges but I now have varying types of objects outside my shape that I need erased. I used to use: (setq lastobject (ssget "X" '((0 . "CIRCLE") (8 . "grain")))) but I now have more than just circles left, besides I could have circle inside the box that I want to not erase.
    Any help with this code would really be helpful.

  5. #5
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,100
    Login to Give a bone
    0

    Default Re: Erase outside the Box

    I would go with Tim suggestion above.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  6. #6
    Member
    Join Date
    2006-02
    Location
    SLC
    Posts
    35
    Login to Give a bone
    0

    Default Re: Erase outside the Box

    Tim how do I remove something from my selection set? can you post some code showing how?

  7. #7
    AUGI Addict
    Join Date
    2005-08
    Posts
    1,043
    Login to Give a bone
    0

    Default Re: Erase outside the Box

    Quote Originally Posted by jseamons
    Tim how do I remove something from my selection set? can you post some code showing how?
    Sure. Here you go.
    Code:
    (defun c:Test (/ ss1 ss2 cnt ent)
    
    (if
     (and
      (not (prompt "\n Select items not to erase: "))
      (setq ss1 (ssget "x" (list (cons 410 (getvar "ctab")))))
      (setq ss2 (ssget))
      (setq cnt -1)
     )
     (while (setq ent (ssname ss2 (setq cnt (1+ cnt))))
      (ssdel ent ss1)
     )
    )
    (if (and ss1 (> (sslength ss1) 0))
     (command "_.erase" ss1 "")
    )
    (princ)
    )

Similar Threads

  1. 2014: Something I can't see and can't erase,,,
    By boyerd492098 in forum AutoCAD General
    Replies: 6
    Last Post: 2015-08-28, 01:36 AM
  2. microstation erase outside fence
    By gugg in forum AutoCAD General
    Replies: 4
    Last Post: 2012-03-14, 05:11 PM
  3. Erase Crossing
    By gjp in forum AutoCAD General
    Replies: 6
    Last Post: 2008-08-14, 06:51 PM
  4. Can't erase items
    By tonyisenhoff in forum Revit Architecture - General
    Replies: 6
    Last Post: 2006-09-11, 04:36 PM
  5. Erase is freaking out.
    By stelthorst in forum AutoCAD General
    Replies: 5
    Last Post: 2005-05-19, 04:33 PM

Posting Permissions

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