(maybe) Save LISP variables with drawing. 2006.

Discussion in 'AutoCAD' started by gruhn, Dec 6, 2005.

  1. gruhn

    gruhn Guest

    my understanding of the problem...

    Our office has our own menu of commands and blocks and tools...

    One tool is to set drawing scale with one click. Set line scale and text
    scale and... It has worked well for years.

    It also sets a variable of our own devising, call it "RARDwgScale".

    Now when a block is interted off our menu the block's scale is set to
    RARDwgScale.

    Boss has noticed that when he sets the scale, draws one of our leaders - it
    looks good.
    Save the drawing. Close. Open. Draw a new leader - it looks bad. RARDwgScale
    is not remembered.

    This is a new behaviour with 2006. It would _seem_ that somewhere "save our
    lisp variables with the drawing" checkbox has been turned off. We would like
    to turn it back on.

    Clues?

    Thanks.

    - gruhn
     
    gruhn, Dec 6, 2005
    #1
  2. gruhn

    Mr. B Guest

    I've not yet used 2006, but what I've been doing for years now is to put the
    Drawing Scale info (metric/imperial and scale value) into Two (2) drawing
    variables (which get saved in the Dwg file).

    If I recall, there are three such varable names you can use (I only use 2 of
    them). They are UserR1 to UserR5 and UserI1 (that is Eye 1) to UserI5. I
    don't think that these are used much by anyone that I've ever come across.
    Most don't even know that they are there (as they do not show up in SETVAR ?.

    I use UserR1 for the scale factor (ie: 96 for 1/8th scale - 8 x 1/8")

    And I use UserI1 for metric or imperial.

    I retrieve them like the following:

    (setq figscl (getvar "UserR1")) ; find Figure Scale factor

    (setq Inmm (getvar "USerI1")) ; find if Inches 1 or MM 0
    (if (= Inmm 0) (setq figscal (* figscl 25.4)))
    (if (= Inmm 1) (setq figscal figscl))


    If you are using In-House custom menus and Lisp routines, you might want some
    one to check a few lines of their sourse code to see what's going on.

    Regards,

    BruceF
     
    Mr. B, Dec 6, 2005
    #2
  3. The problem with the User variables is that other programmers can use them
    too. If you have complete control over the programming environment, that
    shouldn't be a real problem, but if your place is like most places I've
    worked, operators are using all kinds of routines written by god knows
    who...

    I suppose you could run a routine to periodically check the values of these
    things against a list of acceptable values...
     
    Michael Bulatovich, Dec 6, 2005
    #3
  4. We use the "dimscale" variable, which is a system variable that's saved
    in the drawing.

    Martin
     
    Martin Shoemaker, Dec 7, 2005
    #4
  5. gruhn

    Mr. B Guest

    This is true... but in over 7 years of using them, I've never had any issue
    (probably cause hardly anyone uses them or knows they exist). Fortunately for
    me, I usually am the ONLY one who can do any LISP (or other) programming :)

    Regards,

    BruceF
     
    Mr. B, Dec 7, 2005
    #5
  6. How are you using them?
     
    Michael Bulatovich, Dec 7, 2005
    #6
  7. gruhn

    Mr. B Guest

    If I understand your question, I did post in my first message some code that
    is pretty common to alot of my Lisp routines. Simply sets up the variables to
    bring in my Blocks at the correct scale factor.

    And when I load a drawing, after it loads, on the Command Line it shows you
    the drawing scale and if it's metric or imperial (so right off the bat, you
    should know if something is screwed up or not).

    Regards,

    BruceF
     
    Mr. B, Dec 7, 2005
    #7
  8. So that's it? It just reports that info on the command line?
     
    Michael Bulatovich, Dec 7, 2005
    #8
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.