Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Change text case in a attribute block

  1. #1
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Change text case in a attribute block

    Looking for a program that will change the text case in a attribute block. I know about TCASE but I need it to just change the text string that I pick on and not all of the text in the attribute.

    Thanks,

    CADD4LA

  2. #2
    Member
    Join Date
    2006-07
    Location
    Currently Vancouver BC
    Posts
    47
    Login to Give a bone
    0

    Default Re: Change text case in a attribute block

    That should do. command TCASEATT

    (defun c:TCASEATT( / obj)
    (while(setq obj(vlax-eName->vla-object(car(nentsel))))
    (vla-put-TextString obj (strcase(vla-get-TextString obj))))
    )

  3. #3
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: Change text case in a attribute block

    Sorry, the lisp don't work.

    After I select the attribute block and hit enter I get this

    ; error: bad argument type: lentityp nil

    Thanks,

    Cadd4la

  4. #4
    Member
    Join Date
    2006-07
    Location
    Currently Vancouver BC
    Posts
    47
    Login to Give a bone
    0

    Default Re: Change text case in a attribute block

    Quote Originally Posted by cadd4la View Post
    Sorry, the lisp don't work.
    After I select the attribute block and hit enter I get this
    Cadd4la
    Select (pick) attribute directly

  5. #5
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: Change text case in a attribute block

    Quote Originally Posted by cadhelp Van View Post
    Select (pick) attribute directly
    I'm picking on the text that is in the attribute that I want to change the case and still get the same message ; error: bad argument type: lentityp nil

    Thanks,

    Cadd4la

  6. #6
    I could stop if I wanted to
    Join Date
    2002-08
    Posts
    231
    Login to Give a bone
    0

    Default Re: Change text case in a attribute block

    It's the same, but with more control...

    Code:
    (vl-load-com)
    (defun c:TCASEATT( / js obj)
    	(while
    		(not
    			(setq js
    				(ssget "_+.:E:S:N" 
    					(list
    						(cons 0 "INSERT")
    						(cons 67 (if (eq (getvar "CVPORT") 2) 0 1))
    						(cons 410 (if (eq (getvar "CVPORT") 2) "Model" (getvar "CTAB")))
    					)
    				)
    			)
    		)
    	)
    	(setq obj (vlax-ename->vla-object (cadar (ssnamex js 0))))
    	(cond
    		((vlax-property-available-p obj 'TextString)
    			(princ (strcat "\n" (vlax-get obj 'TextString) " -> " (strcase (vlax-get obj 'TextString))))
    			(vlax-put obj 'TextString (strcase (vlax-get obj 'TextString)))
    		)
    	)
    	(princ "\nType REGEN to update")
    	(prin1)
    )

  7. #7
    Member
    Join Date
    2010-10
    Location
    Việt Nam
    Posts
    45
    Login to Give a bone
    0

    Default Re: Change text case in a attribute block

    Or sth like this, keep acet ui & functions ^^
    Code:
    (defun c:tcasei (/ js)
    (acet-error-init (list '("cmdecho" 0) T))
    (while
    		(not (setq js (ssget "_+.:E:S:N"  (list (cons 0 "INSERT")(cons 66 1)))))
    )
    (acet-tcase  (ssadd (cadar (ssnamex js 0))) (car(acet-tcase-ui-dlg)))
    (acet-error-restore)
    )

  8. #8
    Member
    Join Date
    2006-07
    Location
    Currently Vancouver BC
    Posts
    47
    Login to Give a bone
    0

    Default Re: Change text case in a attribute block

    Can you attach a DWG with block with attributes

  9. #9
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: Change text case in a attribute block

    Quote Originally Posted by Bruno.Valsecchi View Post
    It's the same, but with more control...

    Code:
    (vl-load-com)
    (defun c:TCASEATT( / js obj)
    	(while
    		(not
    			(setq js
    				(ssget "_+.:E:S:N" 
    					(list
    						(cons 0 "INSERT")
    						(cons 67 (if (eq (getvar "CVPORT") 2) 0 1))
    						(cons 410 (if (eq (getvar "CVPORT") 2) "Model" (getvar "CTAB")))
    					)
    				)
    			)
    		)
    	)
    	(setq obj (vlax-ename->vla-object (cadar (ssnamex js 0))))
    	(cond
    		((vlax-property-available-p obj 'TextString)
    			(princ (strcat "\n" (vlax-get obj 'TextString) " -> " (strcase (vlax-get obj 'TextString))))
    			(vlax-put obj 'TextString (strcase (vlax-get obj 'TextString)))
    		)
    	)
    	(princ "\nType REGEN to update")
    	(prin1)
    )
    Bruno,

    I was able to get it to work on text that was lowercase and would change it to uppercase but will not change uppercase to lowercase. Also any change this can do the other options that tcase does?

    Thanks,

    Cadd4la

  10. #10
    I could stop if I wanted to cadd4la's Avatar
    Join Date
    2001-12
    Location
    Newport Beach, CA
    Posts
    399
    Login to Give a bone
    0

    Default Re: Change text case in a attribute block

    Quote Originally Posted by ketxu View Post
    Or sth like this, keep acet ui & functions ^^
    Code:
    (defun c:tcasei (/ js)
    (acet-error-init (list '("cmdecho" 0) T))
    (while
    		(not (setq js (ssget "_+.:E:S:N"  (list (cons 0 "INSERT")(cons 66 1)))))
    )
    (acet-tcase  (ssadd (cadar (ssnamex js 0))) (car(acet-tcase-ui-dlg)))
    (acet-error-restore)
    )
    Ketxu,

    This is more what I'm looking for, however I have to first use the TCASE command first in the drawing, then it will work in that drawing. Anyway you can write the code so I don't need to do this?

    Thanks,

    Cadd4la

Page 1 of 2 12 LastLast

Similar Threads

  1. Text: Change Case
    By Wish List System in forum Revit Architecture - Wish List
    Replies: 7
    Last Post: 2016-10-23, 02:14 AM
  2. change exploded block attribute tags to text?
    By johnccole in forum AutoLISP
    Replies: 20
    Last Post: 2011-05-11, 06:32 PM
  3. How to change case in text?
    By david@stearnsarchitecture in forum Revit Architecture - General
    Replies: 6
    Last Post: 2006-10-31, 03:42 PM
  4. Modifying Attribute Text - Change to upper-case
    By stephan.villeneuve in forum AutoCAD General
    Replies: 2
    Last Post: 2005-08-24, 02:24 PM
  5. Change text case
    By patricia.ellistone in forum AutoCAD Wish List
    Replies: 3
    Last Post: 2005-06-13, 05:37 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
  •