 ;层名变大小写面板[mini_layer_strcase].lsp
 ;(setq sty 0)
 (defun c:mini_layer_strcase ( / mai_layer_strcase )

 (defun mai_layer_strcase ( sty / first_case format_name tmp)
     (defun first_case (txt)
	    (strcat (strcase (substr txt 1 1)) (strcase (substr txt 2) T))
     )
     (defun format_name (txt)
	     (cond ((= sty 0) (strcase txt t))
	           ((= sty 1) (strcase txt))
	           ((= sty 2)
			    (setq txt (mai_lst2str (mapcar 'first_case (mai_str2lst txt "_")) "_"))
			    (mai_lst2str (mapcar 'first_case (mai_str2lst txt "-")) "-")
			   )
         )
     )
	 (vlax-for tmp
         (vlax-get (vlax-get (vlax-get-acad-object) 'activedocument) 'layers)
		 (vlax-put tmp 'name (format_name (vlax-get tmp 'name)))
	 )
)
    (mai_last_com "mini_layer_strcase")
    (mai_make_panel_up
        (list "层名变大小写面板"
           (list "选项"
                 (list "层名变小写" "(mai_layer_strcase 0)")
				 nil
                 (list "层名变大写" "(mai_layer_strcase 1)")
				 nil
                 (list "层名首字母大写" "(mai_layer_strcase 2)")
           )
        )
    )
 )

