See the top rated post in this thread. Click here

Results 1 to 8 of 8

Thread: Keep all object of certain layers

  1. #1
    Member
    Join Date
    2018-05
    Posts
    4
    Login to Give a bone
    0

    Unhappy Keep all object of certain layers

    I'm a new new new novice

    I want to delete all object of dxf "NOT" in certain layers(10, 39, 40)
    I've tried many method to do this
    (try to close those layer and select all then delete -- failed. Because ssget "x" will select all include hiden layers...)
    Final I found some way but still had some problem)

    It works as bellow
    (setq ss(ssget "x" '((-4 . "<not")(8 . "10")(-4 . "not>")(-4 . "<not")(8 . "39")(-4 . "not>"))))

    but fail as bellow
    (setq ss(ssget "x" '((-4 . "<not")(8 . "10")(-4 . "not>")(-4 . "<not")(8 . "39")(-4 . "not>")(-4 . "<not")(8 . "40")(-4 . "not>"))))

    I don't know why. Please guide me...

    Apologize for my bad English....

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    2

    Default Re: Keep all object of certain layers

    Hi,

    Have a close look at the following:
    Code:
    (ssget "_X" '((-4 . "<NOT") (8 . "10,39,40") (-4 . "NOT>")))
    Happy coding.

  3. #3
    Member
    Join Date
    2018-05
    Posts
    4
    Login to Give a bone
    0

    Default Re: Keep all object of certain layers

    Quote Originally Posted by Tharwat View Post
    Hi,

    Have a close look at the following:
    Code:
    (ssget "_X" '((-4 . "<NOT") (8 . "10,39,40") (-4 . "NOT>")))
    Happy coding.

    Still failed....
    It works with any combination of any two layers as bellow
    (setq ss(ssget "_X" '((-4 . "<NOT") (8 . "10,39") (-4 . "NOT>"))))
    (setq ss(ssget "_X" '((-4 . "<NOT") (8 . "10,40") (-4 . "NOT>"))))
    (setq ss(ssget "_X" '((-4 . "<NOT") (8 . "39,40") (-4 . "NOT>"))))
    .
    .

    but failed when putting all three layers....
    (setq ss(ssget "_X" '((-4 . "<NOT") (8 . "40,10,39") (-4 . "NOT>"))))
    Why~~~~~~~~~~~~~~~~~

  4. #4
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Keep all object of certain layers

    Hi,

    Are you sure that the name of layers are correct?
    Can you upload a copy of the same drawing that you are try the codes on?

  5. #5
    Member
    Join Date
    2018-05
    Posts
    4
    Login to Give a bone
    0

    Default Re: Keep all object of certain layers

    Quote Originally Posted by Tharwat View Post
    Hi,

    Are you sure that the name of layers are correct?
    Can you upload a copy of the same drawing that you are try the codes on?

    I can't upload .dxf file. So I save it as .dwg file
    Attached Files Attached Files

  6. #6
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Keep all object of certain layers

    Quote Originally Posted by ponyrabbit View Post
    I can't upload .dxf file. So I save it as .dwg file
    All visible objects into your attached drawing reside on layer name 40 and the codes above is to ignore this layer name along with 10,39 so of course you would have no selection.

  7. #7
    Member
    Join Date
    2018-05
    Posts
    4
    Login to Give a bone
    0

    Default Re: Keep all object of certain layers

    I think I find the problem...
    All objects are in those three layer (Nothing in other layer) so nothing for delete function...
    I should judge the selection before delete it.....

    Sorry.....I make such a stupid thing....
    Attached Images Attached Images

  8. #8
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Keep all object of certain layers

    No worries, good luck & happy coding.

Similar Threads

  1. Freeze Individual Layers Located on Object Layers
    By Wish List System in forum Civil 3D Wish List
    Replies: 1
    Last Post: 2017-09-14, 09:53 PM
  2. Object Layers
    By Berryman in forum AutoLISP
    Replies: 14
    Last Post: 2017-07-02, 01:44 AM
  3. FLATSHOT Which maintains object LAYERS
    By Wish List System in forum AutoCAD Wish List
    Replies: 2
    Last Post: 2015-06-25, 01:26 PM
  4. Access Object Sub-entity Layers via the API
    By civil3d.wishlist1941 in forum Civil 3D Wish List
    Replies: 1
    Last Post: 2009-07-24, 06:57 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
  •