(setq newflag (getvar "useri3"))

Discussion in 'AutoCAD' started by maryam, Jul 14, 2004.

  1. maryam

    maryam Guest

    hi any one know what the following command means? what would be the value of newflag in different circumstances?
     
    maryam, Jul 14, 2004
    #1
  2. maryam

    ECCAD Guest

    If useri3 system variable is set to say: 1 (one).
    The statement (setq newflag (getvar "useri3")) .. will set
    the 'value' of 'newflag' variable to a 1.
    Then, later you can check the newflag value..
    e.g.
    (if (= newflag 1)
    (...do something)
    (...else don't)
    ); end if

    Bob
     
    ECCAD, Jul 14, 2004
    #2
  3. USERI3 is a User-definable Integer variable. It would have to have a value
    put in it, but once it does, it is saved with the drawing, so it might not
    show up earlier in the same lisp routine. There are five such
    system-variable slots available, USERI1 through USERI5. There are also
    USERR1 through USERR5 (for real numbers rather than integers), and USERS1
    through 5 for text strings, though for some odd reason the String variables
    are not saved when you exit a drawing.

    We use USERI1 for the ratio of reality to the drawing, for which lots of
    people use DIMSCALE. The value is set during the Setup routine people go
    through when they make new drawings. Then we use it in all sorts of things,
    mostly as a multiplier for specifying insertion scale factors, text heights,
    and the like:

    -INSERT <blockname> S (getvar "USERI1") \0

    in a macro would be used to Insert some graphic symbol which is drawn at the
    size it should appear on paper, and which you wouldn't need to use at any
    rotation other than 0 degress.

    -STYLE <textstylename> <fontname> (* (getvar "USERI1") 0.125) ;;;;;

    would define a text style with a fixed plotted height of 1/8", and no
    obliquing or other options.

    Sometimes in a routine where I expect to use such a scale factor repeatedly,
    I'll put in something to abbreviate it, like:

    (setq mf (getvar "USERI1"))

    so that later I can just say !mf to use it, instead of putting in the whole
    (getvar "USERI1") thing. I'd guess something like that is the purpose of
    the function in your Subject line.

    Kent Cooper, AIA


    of newflag in different circumstances?
     
    Kent Cooper, AIA, Jul 14, 2004
    #3
  4. maryam

    maryam Guest

    WOW... you are awesome. Thank you very much for the information. I was really confused because the useri3 was not defined anywhere, and yet the lisp was using it.
    regards

    maryam
     
    maryam, Jul 15, 2004
    #4
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.