Jump to content

Help Appreciated: Force Existing Layer Names to UPPER CASE Not Working


Recommended Posts

Posted

@Clint Please give it a try 

 

 

(defun c:lay-nam-to-capital (/  (ACAD-OBJ ADOC LAY-COLL))
  (VL-LOAD-COM)
  (SETQ ACAD-OBJ (VLAX-GET-ACAD-OBJECT))  
  (SETQ ADOC (VLA-GET-ACTIVEDOCUMENT ACAD-OBJ)) 
  (SETQ LAY-COLL (VLA-GET-LAYERS ADOC))
  (vlax-for lay	lay-coll
    (vla-put-name lay (strcase (vla-get-name lay)))
  ) ;_ end of vlax-for
) ;_ end of defun

 

  • Like 1
Posted
On 06/12/2025 at 15:56, Clint said:

My task is to hash out a program that reads from two lists and updates layer names to match the old version to both the current name (UPPERCASE).

 

If I getted correct, this can be accomplish, but you need to do a systematization in naming the layers. One of the approaches can be to make an .txt file in which you will store the systematizated layers (the proper order must be, for e.g. "Tropic,Train,Traffic" or "Tropic\n" "Train\n" "Traffic\n" etc. The \n means new line). Then, you will run the code from my post, get an list of layers inside the drawing, then select desired layers to matches with .txt  file from which you want to get a proper names (for e.g. in .txt file you have the layer name "TrAffiC", after choosing the layer "Traffic" in the drawing with "TrAffiC", you can substitued with proper name).

Posted
6 hours ago, devitg said:

@Clint Please give it a try 

 

 

(defun c:lay-nam-to-capital (/  (ACAD-OBJ ADOC LAY-COLL))
  (VL-LOAD-COM)
  (SETQ ACAD-OBJ (VLAX-GET-ACAD-OBJECT))  
  (SETQ ADOC (VLA-GET-ACTIVEDOCUMENT ACAD-OBJ)) 
  (SETQ LAY-COLL (VLA-GET-LAYERS ADOC))
  (vlax-for lay	lay-coll
    (vla-put-name lay (strcase (vla-get-name lay)))
  ) ;_ end of vlax-for
) ;_ end of defun

 

 

 Yes, this will substitued all layers into the UPPERCASE.

Posted
11 hours ago, devitg said:

@Clint Please give it a try 

 

 

(defun c:lay-nam-to-capital (/  (ACAD-OBJ ADOC LAY-COLL))
  (VL-LOAD-COM)
  (SETQ ACAD-OBJ (VLAX-GET-ACAD-OBJECT))  
  (SETQ ADOC (VLA-GET-ACTIVEDOCUMENT ACAD-OBJ)) 
  (SETQ LAY-COLL (VLA-GET-LAYERS ADOC))
  (vlax-for lay	lay-coll
    (vla-put-name lay (strcase (vla-get-name lay)))
  ) ;_ end of vlax-for
) ;_ end of defun

 

As @Clint ask for 

 

Quote

Force Existing Layer Names to UPPER CASE

 

Posted

Yes, but as it for as Title name for the topic. The plot is different. 😅 So, you're code will certenatly accomplish the desired result. 👍

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...