Results 1 to 7 of 7

Thread: Layer change

  1. #1
    I could stop if I wanted to
    Join Date
    2009-10
    Posts
    262
    Login to Give a bone
    0

    Default Layer change

    HTML Code:
     (if (and (= Revision "REVONE")
    	   (null (tblsearch "layer" "EE-REV-1"))
          (command "-layer" "m" "EE-REV-1" "c" "255" "" "")
          )
          (command "-layer" "s" "EE-REV-1" "")
      )

    Anyone willing to take a poke at this and tell me why its not adjusting the layers properly?
    after the layers created

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

    Default Re: Layer change

    It appears you have the layer make routine included within the and function. Is that by design?
    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
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,505
    Login to Give a bone
    0

    Default Re: Layer change

    Quote Originally Posted by Opie View Post
    It appears you have the layer make routine included within the and function. Is that by design?
    That could be part of it, also not sure if the OP is wanting to change the layer or simply create it if it doesn't exist.
    Which it won't in this case, if it exists it will simply move on..
    Code:
       (if
         (=
           (tblsearch "layer" "EE-REV-1") nil)
    (command "-layer" "make" "EE-REV-1" "color" "255" "" "")
         )

  4. #4
    I could stop if I wanted to
    Join Date
    2009-10
    Posts
    262
    Login to Give a bone
    0

    Default Re: Layer change

    Sorry for posting a partial code..i'd like to post the rest but need to get permission first

    Code:
     
    (if (and (= Revision "REVONE")                                              ;;; if variable Revision is set to REVONE
    	   (null (tblsearch "layer" "EE-REV-1"))                            ;;; and layer EE-REV-1 does not exist
          (command "-layer" "m" "EE-REV-1" "c" "255" "" ""))            ;;; make the layer EE-REV-1
          (command "-layer" "s" "EE-REV-1" "")                               ;;; otherwise Set layer to EE-REV-1
      )
    What i would like it to accomplish is when REVONE is the variable of revision is would make or set the layer to EE-REV-1

  5. #5
    I could stop if I wanted to
    Join Date
    2009-10
    Posts
    262
    Login to Give a bone
    0

    Default Re: Layer change

    Code:
    (if (= Revision "REVONE")
          (cond  (null (tblsearch "layer" "EE-REV-1"))
          (command "-layer" "m" "EE-REV-1" "c" "255" "" ""))
      )
    
      
    (command "-layer" "s" "EE-REV-1" "")
    Got it thanks for the hint

  6. #6
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    555
    Login to Give a bone
    0

    Default Re: Layer change

    Just me
    Code:
    (command "-layer" "s" "EE-REV-1" "")
    (setvar 'clayer "EE-REV-1")

  7. #7
    Woo! Hoo! my 1st post
    Join Date
    2016-07
    Posts
    1
    Login to Give a bone
    0

    Question Re: Layer change

    I have never posted on this forum and is dumb with forums in general, and cannot see athread that remotely discusses my problem, but cannot see where to create a new one?! Ahhhh! Anyway, who-ever reads this should be able to point me in some kind of direction;

    I have an existing drawing with 20 tabs. 6 of those tabs details (Paper an modelspacce) needs to be changed to ASBUILT (in other words all lineweights changed to 0.00). I have spent hours finding a lsp (an existing one as i do not know how to create or change a lsp routine) that changes all selected objects to 0.00. I did not find one. I ended up copying all objects relevant that needs to be 0.00 lineweight to a new acadiso.dwt file, with the idea to repaste to existing drawing after all lineweights was changed manually. (I prefer doing it on a seperate dwt file so i can use my select-all (CTL-A) function without hesitation, as the original drawing is VEEERY messy. Okay, I got that done. Then I used a routine that renames all layers with a suffix of "ASBUIT", so that the original layer properties do not overwrite, and by doing so, undo, my efforts thus far.

    No here is my problem. The original 20 users of this drawing file has been Layer-0-happy. Many of the objects, blocks, text, dimensions is on layer 0, which cannot be renamed or deleted!

    I want to MOVE all items from layer 0 to a newly create layer "0_ASBUILT"

    Please help.

Similar Threads

  1. Replies: 5
    Last Post: 2008-11-27, 06:38 AM
  2. Replies: 6
    Last Post: 2007-05-30, 05:45 PM
  3. Replies: 10
    Last Post: 2007-04-27, 06:17 PM
  4. Replies: 7
    Last Post: 2006-10-23, 04:18 AM
  5. Change display of layer without changing layer properties
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2006-09-11, 02: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
  •