See the top rated post in this thread. Click here

Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 36

Thread: Remove $0$ and everything before from Layer names

  1. #11
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Remove $0$ and everything before from Layer names

    Quote Originally Posted by CAB2k
    Perhaps this will help.
    and the rest ?
    Quote Originally Posted by kennet.sjoberg
    . . . if there is block in the binded xref ( and of course there is ) you have problem in problem.
    and it is not only layers, it is textfons, linefonts, dimensionstyles. . . .
    : ) Happy Computing !

    kennet

  2. #12
    I could stop if I wanted to tyshofner's Avatar
    Join Date
    2004-03
    Location
    Dallas, Tx
    Posts
    229
    Login to Give a bone
    1

    Default Re: Remove $0$ and everything before from Layer names

    Here is one I wrote a while back to accomplish this very task. It's not perfect, it will leave a few bound layers sometimes. Though I have found that EVERY object is converted, it just can't get rid of the layers because they are stuck in a block (that wasn't created correctly) or one of the other many reasons why a layer cannot be purged. When I wrote this I didn't have the time to research it enough, plus it takes care of all the objects (which is what I wanted) so I was happy. Try it out and let me know. Feel free to modify it if need be.

    Ty
    Attached Files Attached Files
    Last edited by tyshofner; 2006-01-11 at 05:22 PM.

  3. #13
    All AUGI, all the time CAB2k's Avatar
    Join Date
    2016-01
    Location
    Brandon, Florida
    Posts
    687
    Login to Give a bone
    0

    Default Re: Remove $0$ and everything before from Layer names

    Quote Originally Posted by kennet.sjoberg
    and the rest ?
    Hey Kennet,

    My post was in response to this request.

    Quote Originally Posted by kylec_edg
    Any Ideas on how to get around this maybe when it reads the layer name it can add a "X"
    and a "number" that increases, I just looking to get the layer names to be smaller.

    bko_451-xf-1a1$0$ABVBLW to X1ABVBLW

    bko_451-xf-1b1$0$ABVBLW to X2ABVBLW
    etc.
    It will rename the layers as requested.
    I did not say it was a panacea for all the problems that may exist.

    Thank you,

  4. #14
    AUGI Addict kennet.sjoberg's Avatar
    Join Date
    2002-05
    Posts
    1,707
    Login to Give a bone
    0

    Default Re: Remove $0$ and everything before from Layer names

    Quote Originally Posted by CAB2k
    . . . My post was in response to this request. . .
    Yes, that is true,
    but I suppose Kyle do not know about the rest of the problems that "bind as bind" cause,
    . . .but it exists routines that fix that to .

    : ) Happy Computing !

    kennet

  5. #15
    I could stop if I wanted to Hammer.John.J's Avatar
    Join Date
    2015-09
    Location
    Springfield, MA
    Posts
    491
    Login to Give a bone
    0

    Default Re: Remove $0$ and everything before from Layer names

    did anybody try that lisp?

    before i try it can you explain breifly how it works?

  6. #16
    All AUGI, all the time CAB2k's Avatar
    Join Date
    2016-01
    Location
    Brandon, Florida
    Posts
    687
    Login to Give a bone
    0

    Default Re: Remove $0$ and everything before from Layer names

    John,
    If you are referring to my lisp it only renames the layers.
    It would rename these as follows:

    Aproved Title Block D$0$xHEAVY
    xref block test$0$TestLayer01

    changed to this:

    X1-xHEAVY
    X2-TestLayer01

  7. #17
    I could stop if I wanted to tyshofner's Avatar
    Join Date
    2004-03
    Location
    Dallas, Tx
    Posts
    229
    Login to Give a bone
    0

    Default Re: Remove $0$ and everything before from Layer names

    John,

    If you were asking about my LISP??

    It will scan all the objects in a drawing (including inside blocks), check to see if they are on a bound layer, i.e. X01-AFP$0$A-WALL, if the object is on a bound layer it will remove the binding info from the layer name, check the layer table to see if that layer already exists, if it exists the object is moved to that layer. If the layer does not exist then it will grab the layer information from the bound layer (color, linetype, etc.) and make a new layer with the correct name, i.e. A-WALL, and then move the object to that layer. Once through all the objects it purges the drawing to remove the bound layers.

    Ty

  8. #18
    I could stop if I wanted to Hammer.John.J's Avatar
    Join Date
    2015-09
    Location
    Springfield, MA
    Posts
    491
    Login to Give a bone
    0

    Default Re: Remove $0$ and everything before from Layer names

    Quote Originally Posted by tyshofner
    John,

    If you were asking about my LISP??

    It will scan all the objects in a drawing (including inside blocks), check to see if they are on a bound layer, i.e. X01-AFP$0$A-WALL, if the object is on a bound layer it will remove the binding info from the layer name, check the layer table to see if that layer already exists, if it exists the object is moved to that layer. If the layer does not exist then it will grab the layer information from the bound layer (color, linetype, etc.) and make a new layer with the correct name, i.e. A-WALL, and then move the object to that layer. Once through all the objects it purges the drawing to remove the bound layers.

    Ty
    both lisps are cool...... but i think this one will have larger benefits for translating architecture to our layering style, translating base maps etc. layertranslater is great if both drawings have the same layer names... however mapping every time you translate sucks and it would be great to see if this would work to translate x layer to y layer and force all objects on x layer to be y layer 'bylayer'

    how do you actually "do" the mapping of x layer to y layer?

  9. #19
    I could stop if I wanted to tyshofner's Avatar
    Join Date
    2004-03
    Location
    Dallas, Tx
    Posts
    229
    Login to Give a bone
    0

    Default Re: Remove $0$ and everything before from Layer names

    Quote Originally Posted by johnh.101098
    both lisps are cool...... but i think this one will have larger benefits for translating architecture to our layering style, translating base maps etc. layertranslater is great if both drawings have the same layer names... however mapping every time you translate sucks and it would be great to see if this would work to translate x layer to y layer and force all objects on x layer to be y layer 'bylayer'

    how do you actually "do" the mapping of x layer to y layer?
    This is the actual piece of code that moves the object to the new layer.

    Code:
     
     (setq obj_alst (subst (cons 8 obj_lyr_new) (assoc 8 obj_alst) obj_alst))
     (entmod obj_alst)
    What exactly do mean by "translate" to your layers? Are you wanting to, after the bound layers have been fixed, then "translate" those layers to your layering standard, or am I missing something?

    Ty

  10. #20
    I could stop if I wanted to Hammer.John.J's Avatar
    Join Date
    2015-09
    Location
    Springfield, MA
    Posts
    491
    Login to Give a bone
    0

    Default Re: Remove $0$ and everything before from Layer names

    well it sounds like you are removing parts of the layer names... so how does it find what part of the layer name to remove so that you could potentially find layers with a given name and then convert them to another name, as a routine.

    so everytime i get a drawing from joe pie his layers have a routine that get translated through this routine from say...

    point-dumb to pnt-misc
    x-epcurb to x-curb
    x-ep to x-eop


    etc etc etc. your routine seems close to that, it's finding something in the layername using some sort of list, removing the names from the layers all at once instead of editing them by hand.

Page 2 of 4 FirstFirst 1234 LastLast

Similar Threads

  1. Replies: 11
    Last Post: 2009-02-27, 04:25 PM
  2. Replies: 6
    Last Post: 2007-05-30, 02:02 PM
  3. Replies: 2
    Last Post: 2007-01-09, 06:39 AM
  4. Change Layer names to other Layer names via a script?
    By tburke in forum AutoCAD Customization
    Replies: 5
    Last Post: 2006-12-04, 07:30 PM
  5. Replies: 12
    Last Post: 2006-10-06, 07:07 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
  •