change dimstyle

Discussion in 'AutoCAD' started by robinpharoah, Jul 10, 2003.

  1. robinpharoah

    robinpharoah Guest

       Hi. I am looking for lisps that will enable me to change my dimstyle with keystrokes. For example, I have styles named "1 DECIMAL", 2 DECIMAL, etc.
       I have searched this group and have found a useful lisp that lets you pick a dimension to make it's style current. But I would also like to punch in, say, "D2"(enter) for style "2 DECIMAL". (R2002)
       Any help would be appreciated.
          Thankyou, Robin
     
    robinpharoah, Jul 10, 2003
    #1
  2. robinpharoah

    Michel Guest

    (defun c:d2 ()
    (command "_-dimstyle" "_r" "2 decimal")
    (princ)
    )

    robinpharoah a écrit :
     
    Michel, Jul 10, 2003
    #2
  3. robinpharoah

    Mike Weaver Guest

    Robin,



    Try this:



     



    (defun c:d1()(ezdimstyle "1 decimal"))
    (defun c:d2()(ezdimstyle "2 decimal"))



     



    (defun ezdimstyle(   ;set a specified dimstyle current
        dsname  ;name of the dimstyle
        /   ;end of formal arguments
        cmdecho
        )   ;end of local variable list
      (if (tblsearch "dimstyle" dsname)
        (progn
          (setq cmdecho (getvar "cmdecho"))
          (setvar "cmdecho" 0)
          (command "._dimstyle" "r" dsname)
          (setvar "cmdecho" cmdecho)
          )
        (princ (strcat "\Unknown dimstyle name: " dsname))
        )
      (princ)
      )




    Mike Weaver



     



    "robinpharoah" <> wrote in message news:...

       Hi. I am looking for lisps that will enable me to change my dimstyle with keystrokes. For example, I have styles named "1 DECIMAL", 2 DECIMAL, etc.
       I have searched this group and have found a useful lisp that lets you pick a dimension to make it's style current. But I would also like to punch in, say, "D2"(enter) for style "2 DECIMAL". (R2002)
       Any help would be appreciated.
          Thankyou, Robin
     
    Mike Weaver, Jul 10, 2003
    #3
  4. robinpharoah

    robinpharoah Guest

      Michel.It works great.I added (GRAPHSCR) to the end to close the text window also.
                   Thankyou, Robin.
     
    robinpharoah, Jul 10, 2003
    #4
  5. robinpharoah

    robinpharoah Guest

        Thankyou Mike. This works great also, and the text screen doesn't seem to pop up and down, either.
                  Robin.
     
    robinpharoah, Jul 10, 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.