Visual Lisp and variables

Discussion in 'AutoCAD' started by mikedsjr, May 17, 2004.

  1. mikedsjr

    mikedsjr Guest

    I have been writing lisp routines to do setups of variables, which basically are a bunch of (command "angdir" "0") and more. And i know this can't be the best way to do this within lisp or visual lisp, because when i do this it doesn't do it behind the scene but pops up the screen window which then i have to add (graphscr) after the program runs.

    I'm hoping this makes since and want to know what a better way to doing this, whether it involves lisp, Visual Lisp or something else beside C++

    Thanks
     
    mikedsjr, May 17, 2004
    #1
  2. mikedsjr

    kemp Guest

    Try this

    (setvar "angdir" 0)

    kemp

    basically are a bunch of (command "angdir" "0") and more. And i know this
    can't be the best way to do this within lisp or visual lisp, because when i
    do this it doesn't do it behind the scene but pops up the screen window
    which then i have to add (graphscr) after the program runs.
    this, whether it involves lisp, Visual Lisp or something else beside C++
     
    kemp, May 17, 2004
    #2
  3. mikedsjr

    C Witt Guest

    also..
    you can do this rather than the "graphscr" method..

    (setvar "cmdecho" 0)
    lisp
    (setvar "cmdecho" 1)

    prevents 95% of window popups & stops the "commands" from showing up in
    the command bar.. (no need to tell your users what is going on).
     
    C Witt, May 17, 2004
    #3
  4. mikedsjr

    mikedsjr Guest

    Is this what most people do?

    I'm interested in whether there is an easier way within Visual Lisp. Are there any?
     
    mikedsjr, May 19, 2004
    #4
  5. mikedsjr

    mikedsjr Guest

    I'm basically wanting to cut down on the useless empty lines that seem to page through.

    Here is an example:

    (DEFUN C:setOneFourth ()
    (setvar "cmdecho" 0)
    (COMMAND "-STYLE" "1-4" "ARCHITXT" "5" ".8" "0" "N" "N") (COMMAND "EXPERT" "5")
    (COMMAND "DIMSTYLE" "S" "1-4")
    (SETVAR "LUNITS" 4)
    (COMMAND "ANGDIR" "0")
    (COMMAND "ANGBASE" "0")
    (COMMAND "AUNITS" "0")
    (COMMAND "AUPREC" "0")
    (COMMAND "LUPREC" "0")
    (COMMAND "DIMSD1" "OFF")
    (COMMAND "DIMSD2" "OFF")
    (COMMAND "DIMDLE" "2.5")
    (COMMAND "DIMDLI" "5")
    (COMMAND "DIMCLRD" "0")
    (COMMAND "DIMBLK" "ARCHTICK")
    (COMMAND "DIMASZ" "2.5")
    (COMMAND "DIMSE1" "OFF")
    (COMMAND "DIMSE2" "OFF")
    (COMMAND "DIMEXE" "2.5")
    (COMMAND "DIMEXO" "2.5")
    (COMMAND "DIMCLRE" "0")
    (COMMAND "DIMCEN" "1")
    (COMMAND "DIMSCALE" "1")
    (COMMAND "DIMUPT" "OFF")
    (COMMAND "DIMTOFL" "ON")
    (COMMAND "DIMFIT" "4")
    (COMMAND "DIMTIH" "OFF")
    (COMMAND "DIMTOH" "OFF")
    (COMMAND "DIMJUST" "0")
    (COMMAND "DIMTAD" "1")
    (COMMAND "DIMPOST" ".")
    (COMMAND "DIMTXSTY" "1-4")
    (COMMAND "DIMTXT" "5")
    (COMMAND "DIMGAP" "2.5")
    (COMMAND "DIMCLRT" "0")
    (COMMAND "DIMRND" "0")
    (COMMAND "DIMUNIT" "6")
    (COMMAND "DIMDEC" "0")
    (COMMAND "DIMZIN" "3")
    (COMMAND "DIMAUNIT" "0")
    (COMMAND "LTSCALE" "15")
    (COMMAND "PDMODE" "0")
    (COMMAND "MENUCTL" "0")
    (COMMAND "DIMSTYLE" "S" "1-4")
    (COMMAND "EXPERT" "1")
    (SETVAR "USERI3" 14)
    (setvar "cmdecho" 1)
    (PRINC)
    )

    Unless I unintentionally erased something this is a working lisp file.
     
    mikedsjr, May 19, 2004
    #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.