Prompting Setenv value in regular AutoCAD

Discussion in 'AutoCAD' started by Mark Gonzales, Oct 14, 2003.

  1. Hello. I've written some menu macros for AutoCAD LT that I'd like to work
    with regular AutoCAD while keeping the syntax as similar as possible. The
    problem is that AutoCAD and AutoCAD LT don't use the Setenv and Getenv
    commands the same way.

    For example, in AutoCAD LT:

    "_setenv Length 2000 " sets Length to 2000 in Registry

    Same as AutoCAD:

    (setenv "Length" "2000")


    - BUT-


    In AutoCAD LT,

    "_setenv Length \" prompts the user for the value of Length which can
    be retrieved later with Getenv.

    How would I do this in regular AutoCAD?

    (setenv "Length" \) doesn't work
     
    Mark Gonzales, Oct 14, 2003
    #1
  2. Follow-up:
    ========

    This is how I'm doing it for now...

    _userr1 \(setenv "Length" (getvar "userr1"))

    Enter new value for USERR1:


    I was wondering if there was a simpler way which would include "Length" as
    part of the prompt.

    In AutoCAD LT:

    "_setenv Length \ "

    Length Value:


    Again, I'd like AutoCAD to match LT as closely as possible in both syntax
    and prompts, if possible.
     
    Mark Gonzales, Oct 14, 2003
    #2
  3. Paul,

    You have no idea how many of your old posts I've read in the past 24 hours
    trying to figure this one out. Thanks, man!

    But I can't seem to get this to work in AutoCAD 2000 trying:

    ID_SetLength [Set Length]^C^C(setenv "Length" (getdist "\nLength: "))

    I ony get:

    Command: (setenv "Length" (getdist "


    Could you do me another favor? Could you show me exactly how I might write a
    menu macro which would set MaxHatch (a popular reason for using SETENV in
    AutoCAD)?

    For example, to set the maximum hatch density:

    ID_SetMaxHat [Set Max Hatch Density]^C^C(setenv "MaxHatch""10000000")


    But to prompt the user for the density value, shouldn't it be?

    ID_SetUsrHat [Set Hatch Density]^C^C(setenv "MaxHatch" (getstring
    "\nValue: "))

    Again, I'm only getting:

    Command: (setenv "MaxHatch" (getstring "
    --


    Thanks again,
    Mark
     
    Mark Gonzales, Oct 14, 2003
    #3
  4. WooHoo! That's it! Thanks a million! ;-)
    --


    Mark


     
    Mark Gonzales, Oct 14, 2003
    #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.