using getvar for calculations

Discussion in 'AutoCAD' started by MechMan, Jul 14, 2003.

  1. MechMan

    MechMan Guest

    I'm back with another simple question. How do you use a system variable in a calculation to set another variable? I'll use the DIMSCALE variable for an example. Let's say I want to write an equation using the DIMSCALE variable to help set another variable. What's the proper format? I've tried several variations of:



    (getvar "dimscale")/2



    but no dice yet.


    TIA



    MechMan
     
    MechMan, Jul 14, 2003
    #1
  2. MechMan

    mhr Guest

    (/ (Getvar "DIMSCALE") 2.0)
     
    mhr, Jul 14, 2003
    #2
  3. MechMan

    BillZ Guest

    Another example:

    (setvar "dimscale" (/ r1 2.0))

    to set dimscale (or other var) to a value.

    Bill
     
    BillZ, Jul 14, 2003
    #3
  4. MechMan

    MechMan Guest

    Thanks!



    MechMan
     
    MechMan, Jul 14, 2003
    #4
  5. MechMan

    MechMan Guest

    Ok, here's a continuation of this subject. What was offered above works great for some commands but now I want to scale my limits based on the DIMSCALE variable but the LIMITS command doesn't seem to like it. I've tried different variations of:



    LIMITS;0,0;(*12 (getvar "dimscale")),(*9 (getvar "dimscale"));



    Note: this is a button macro I'm creating. I don't know LISP.



    What I'm trying to do is to set the max limits to be "DIMSCALE" x initial value given (x=12,y=9) in a template file.



    Yes it's probably crude but it's all I know.



    Any ideas on how I can get this to work?



    MechMan
     
    MechMan, Jul 14, 2003
    #5
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.