Results 1 to 3 of 3

Thread: Issue renaming layers with special characters

  1. #1
    Member
    Join Date
    2015-12
    Posts
    4
    Login to Give a bone
    0

    Default Issue renaming layers with special characters

    Hi, Why sometimes this operation returns wrong:

    Code:
    (defun c:cvt()
    (setq oldname "ESP - Esquadrias CIR")(setq newname "ANT - Esquadria Círculo")(runtorenamelayer)
    )
    (defun runtorenamelayer()
    	(if
    		(and(tblsearch "layer" oldname)(not(tblsearch "layer" newname)))
    			(COMMAND "._-RENAME" "LA" OLDNAME NEWNAME);;(command "._-layer" "R" oldname newname "")
    	)
    	(if
    		(and(tblsearch "layer" oldname)(tblsearch "layer" newname))
    		(progn
    			(command "Laymrg") (foreach e (list oldname) (if (tblsearch "LAYER" e)(command "_Name" e)))(command "" "_N" newname "_Y")
    			;;(command "_.-PURGE" "_La" oldname "_N")
    		)
    	)
    (princ)
    )
    Being specific, if I load the code with the appload or even in the ACAD.LSP the problem occurs.
    And the result is a strange name:

    ANT - Esquadria Círculo

    If I just copy and paste the code into the command bar it works fine and te name is ok:

    ANT - Esquadria Círculo

    Ok, I am thinking about avoiding special characters in the new Layer names, but in some cases the old layers have them already, and in this situation the operation doesn't rename that old layers, the application just skip them because the names doesn't match.

    TIA

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

    Default Re: Issue renaming layers with special characters

    Quote Originally Posted by bernardigustavo View Post
    Ok, I am thinking about avoiding special characters in the new Layer names.

    TIA
    That would be in your best interest. Lots of others have had similar issues not just with code, but sorting and filtering as well.
    https://forums.autodesk.com/t5/autoc...386543#M171990

  3. #3
    Member
    Join Date
    2015-12
    Posts
    4
    Login to Give a bone
    0

    Default Re: Issue renaming layers with special characters

    Thanks for answering. I think that isn't the same problem.

    But I think I found a way, reading from a txt file it worked fine. I'll do some experiments to see if the problem remains or not.

Similar Threads

  1. Special Characters w Mtext..
    By randyspear in forum AutoCAD Sheet Set Manager
    Replies: 0
    Last Post: 2010-03-24, 10:02 PM
  2. Special Text Characters?
    By pmcelwee in forum Revit Architecture - General
    Replies: 4
    Last Post: 2009-03-20, 10:09 PM
  3. Back To Special Characters. . .
    By TerribleTim in forum AutoCAD Sheet Set Manager
    Replies: 2
    Last Post: 2009-01-29, 07:16 PM
  4. Special Characters - Perpendicular
    By smeyer in forum AutoCAD General
    Replies: 6
    Last Post: 2008-02-22, 04:50 PM
  5. Special characters
    By cadkiller in forum Revit Architecture - General
    Replies: 6
    Last Post: 2005-01-03, 05:54 PM

Tags for this Thread

Posting Permissions

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