CASE SENSITATIVE

Discussion in 'AutoCAD' started by Douglas Barr, Nov 4, 2004.

  1. Douglas Barr

    Douglas Barr Guest

    (if (/= (strcase (getvar "clayer")) "P-TXT")
     
    Douglas Barr, Nov 4, 2004
    #1
  2. Douglas Barr

    Jeff Clark Guest

    I have this tiny toggle routine for setting layers, dimstyles & text styles.
    Works fantastic, except when the layer names are not all upper case, which
    causes the routine to error out.

    Here it is:

    (defun C:TOGGLE ( )
    (if (/= (getvar "clayer") "P-TXT")
    (progn
    (setvar "clayer" "P-TXT")
    (command "._dimstyle" "_r" "PROP")
    (setvar "textstyle" "PROP")
    ); progn
    (progn
    (setvar "clayer" "E-TXT")
    (command "._dimstyle" "_r" "EXIST")
    (setvar "textstyle" "EXIST")
    ); progn
    ); if
    (princ)
    )

    I just hit a DWG where the E-TXT layer was "e-TXT" and it did not recognize
    it.
    Can someone show me hot to get this to function regardless of text case?


    Thanks
    --
    Jeffrey A. Clark
    Project Designer
    Consulting Engineer Services
    856/228-2200
     
    Jeff Clark, Nov 4, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.