Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Prefix/Suffix Lisp

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

    Default Re: Prefix/Suffix Lisp

    Quote Originally Posted by kylec_edg
    rkmcswain,

    Thank you for the code & just want to give you a heads up (see comment in "red"). after I fix that problem it runs great.


    Kyle C.
    A better check would be to have all the layers names capitol in the list, and then use
    Code:
    (if (not (member (strcase layName)
    		 '("0"	 "DEFPOINTS"
    		 "MVIEW"	 "NONPRINT"
    		 "SCAN"	 "XREF"
    		 "XREF-REF"
    		 )
    	 )
    )

  2. #12
    AUGI Addict .T.'s Avatar
    Join Date
    2000-12
    Location
    Lost
    Posts
    1,473
    Login to Give a bone
    0

    Default Re: Prefix/Suffix Lisp

    Thanks for the clarification, guys.

    File this under "You learn something new everyday...".

  3. #13
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,804
    Login to Give a bone
    0

    Default Re: Prefix/Suffix Lisp

    Another version.

    Code:
    (defun C:LPFIX (/ acadDocument theLayers layName pre suf)
      (vl-load-com)
      (defun layer-mod (theLayer)
        (setq layName (vlax-get-property theLayer 'Name))
        (if	(not (member (strcase layName)
    		     '("0"	    "DEFPOINTS"
    		       "MVIEW"	    "NONPRINT"
    		       "SCAN"	    "XREF"
    		       "XREF-REF"
    		      )
    	     )
    	)
          (vla-put-Name thelayer (strcat pre layName suf))
        )
      )
      (setq pre (getstring "\n Enter Layer Prefix: "))
      (setq suf (getstring "\n Enter Layer Suffix: "))
      (setq acadDocument (vla-get-activedocument (vlax-get-acad-object)))
      (setq theLayers (vla-get-layers acadDocument))
      (vlax-map-collection theLayers 'layer-mod)
      (vlax-release-object theLayers)
      (vlax-release-object acadDocument)
      (princ)
    )
    (prompt "\n Type LPFIX to run.........")
    (princ)
    Fixes the lowercase vs. capital problem also.
    R.K. McSwain | CAD Panacea |

  4. #14
    Woo! Hoo! my 1st post
    Join Date
    2015-10
    Posts
    1
    Login to Give a bone
    0

    Default Re: Prefix/Suffix Lisp

    Ok i realize this is an old thread but can this layer prefix be modified to remove a prefix or is it going to be easier to just use the rename command?

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

    Default Re: Prefix/Suffix Lisp

    I think it might be easier to use the command line version of rename instead of trying to change the code supplied to do what you want.

  6. #16
    I could stop if I wanted to
    Join Date
    2001-10
    Location
    Defragging the internets.
    Posts
    350
    Login to Give a bone
    0

    Default Re: Prefix/Suffix Lisp

    This routine is the closest to what I need. Can the routine be changed to keep the first letter of the objects layer and add a new letter after the first?
    Example add 2 to the layer:
    A-xxx = A2-xxx
    This would only aply if the second character is a -. I could add to the layer filter "??-*".
    Could I use vl-string-subst to change the - to 2-
    Last edited by framedNlv; 2019-09-23 at 03:26 PM.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Dim Prefix Suffix
    By U.Rackharrow in forum AutoLISP
    Replies: 2
    Last Post: 2009-05-01, 03:47 PM
  2. Dimension prefix and suffix
    By clog boy in forum Revit Architecture - General
    Replies: 2
    Last Post: 2007-04-19, 01:01 PM
  3. Prefix / Suffix for Attributes
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2007-03-02, 06:09 PM
  4. Add a Prefix/Suffix to Text
    By ReachAndre in forum AutoLISP
    Replies: 3
    Last Post: 2006-12-26, 08:14 PM
  5. 8.1/E - Dim Prefix and Suffix on Options Bar
    By janunson in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2006-02-01, 07:41 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
  •