See the top rated post in this thread. Click here

Results 1 to 6 of 6

Thread: access toolbar button from keyboard

  1. #1
    100 Club tomcarver's Avatar
    Join Date
    2015-11
    Location
    Tucker, GA
    Posts
    106
    Login to Give a bone
    0

    Default access toolbar button from keyboard

    Hi Folks,
    I wanted a button for fillet with 0 radius. I finally found what I was looking for and added the star at the beginning so it would repeat until canceled.
    How do I turn this *^C^C_fillet;r;0;; into a lisp program so I can access it from the keyboard.

    Thanks

  2. #2
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    555
    Login to Give a bone
    0

    Default Re: access toolbar button from keyboard

    A couple of ways the easiest is r0 just make a lisp defun and load it on start up. If you want repeat a bit ugly but add a while to start of, code it will give error but ignore when using Esc to exit.

    Code:
    (defun c:r0 ()
    (setvar "filletrad" 0)
    (command "fillet")
    )
    The second something I have is R100 r56-75 r0 Just type R then the radius as one word it recognises the R and pulls the radius out of the balance of the entry the use of - for . is necessary as command line uses a period it takes a little to get used to. Also Circle and offset o12-25

  3. #3
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,655
    Login to Give a bone
    1

    Default Re: access toolbar button from keyboard

    The Shift key is for many shortcuts in AutoCAD including FILLET with a radius of 0, see shortcut #4: https://knowledge.autodesk.com/suppo...t-autocad.html

    No need to add another command. Learning these six ways to use shift will make you more productive.

  4. #4
    AUGI Addict madcadder's Avatar
    Join Date
    2000-11
    Location
    Too far from the beach
    Posts
    1,054
    Login to Give a bone
    0

    Default Re: access toolbar button from keyboard

    For your acaddoc.lsp

    Code:
    ;;; loads on first use QuickFillet.lsp 
    (autoload "QuickFillet.lsp" '("fr" "sf" "f0"))
    The lisp:

    Code:
    ;;; QuickFillet.lsp version 1.0
    ;;; Created to set a temporary, a permanent, and a temporary zero
    ;;; FILLET radius.
    ;;; Copyright 01/29/01 by Tod Winn
    ;;;
    ;;; Version 1.1 05/08/01 to fix a minor bug, remove UNDO marks,
    ;;; and add a looping of the fillet function.
    ;;;
    ;;; Error function definition
    ;;;
    (defun |filleterror| (|msg|)
      (if (or (= |msg| "Function cancelled")
    	  (= |msg| "quit / exit abort")
          )
        (princ (strcat "\nError: " |msg|))
      )
      (setvar "cmdecho" |cmdecho|)
      (setvar "filletrad" |filletrad|)
      (setq *error* |olderror|)
      (princ)
    )
    
    ;;; For FILLET with a temporary radius.  Radius is not permanently
    ;;; stored.
    ;;;
    (defun c:fr (/		   |enta|	 |entb|	       |filletrad|
    	     |lunits|	   |luprec|	 |newfilletrad|
    	     |olderror|
    	    )
      (setq |olderror| *error*)
      (setq *error* |filleterror|)
      (setq |cmdecho| (getvar "cmdecho"))
      (setvar "cmdecho" 0)
      (setq |filletrad| (getvar "filletrad"))
      (setq |lunits| (getvar "lunits"))
      (setq |luprec| (getvar "luprec"))
      (initget 4 "|filletrad|")
      (setq	|newfilletrad|
    	 (getreal (strcat "\nEnter Temporary Fillet Radius <"
    			  (rtos |filletrad| |lunits| |luprec|)
    			  ">: "
    		  )
    	 )
      )
      (if (= |newfilletrad| nil)
        (setq |newfilletrad| |filletrad|)
      )
      (setvar "filletrad" |newfilletrad|)
      (setq |enta| (entsel "\nSelect first object: "))
      (redraw (car |enta|) 3)
      (while (/= |enta| nil)
        (setq |entb| (entsel "\nSelect second object: "))
        (command "fillet" |enta| |entb|)
        (setq |enta| (entsel "\nSelect first object <Return to Exit>: "))
        (redraw (car |enta|) 3)
      )
      (setvar "cmdecho" |cmdecho|)
      (setvar "filletrad" |filletrad|)
      (setq *error* |olderror|)
      (princ)
    )
    
    
    ;;; For setting a new FILLET radius.
    ;;;
    (defun c:sf (/ |filletrad| |lunits| |luprec| |newfilletrad| |olderror|)
      (setq |olderror| *error*)
      (setq *error* |filleterror|)
      (setq |cmdecho| (getvar "cmdecho"))
      (setvar "cmdecho" 0)
      (setq |filletrad| (getvar "filletrad"))
      (setq |lunits| (getvar "lunits"))
      (setq |luprec| (getvar "luprec"))
      (initget 4 "|filletrad|")
      (setq	|newfilletrad|
    	 (getreal (strcat "\nEnter New Fillet Radius <"
    			  (rtos |filletrad| |lunits| |luprec|)
    			  ">: "
    		  )
    	 )
      )
      (if (= |newfilletrad| nil)
        (setq |newfilletrad| |filletrad|)
      )
      (setvar "filletrad" |newfilletrad|)
      (princ (strcat "\Fillet Radius now set to: <"
    		 (rtos |newfilletrad| |lunits| |luprec|)
    		 "> "
    	 )
      )
      (setvar "cmdecho" |cmdecho|)
      (setq *error* |olderror|)
      (princ)
    )
    
    ;;; For setting a temporary FILLET radius of zero.
    ;;;
    (defun c:f0 (/ |enta| |entb| |filletrad| |lunits| |luprec| |olderror|)
      (setq |olderror| *error*)
      (setq *error* |filleterror|)
      (setq |cmdecho| (getvar "cmdecho"))
      (setvar "cmdecho" 0)
      (setq |filletrad| (getvar "filletrad"))
      (setq |lunits| (getvar "lunits"))
      (setq |luprec| (getvar "luprec"))
      (setvar "filletrad" 0.00000000)
      (princ (strcat "\nFillet Radius Temporarily Set To: <"
    		 (rtos (getvar "filletrad") |lunits| |luprec|)
    		 "> \n"
    	 )
      )
      (setq |enta| (entsel "\nSelect first object: "))
      (redraw (car |enta|) 3)
      (while (/= |enta| nil)
        (setq |entb| (entsel "\nSelect second object: "))
        (command "fillet" |enta| |entb|)
        (setq |enta| (entsel "\nSelect first object <Return to Exit>: "))
        (redraw (car |enta|) 3)
      )
      (setvar "cmdecho" |cmdecho|)
      (setvar "filletrad" |filletrad|)
      (setq *error* |olderror|)
      (princ)
    )
    ;;; eof

  5. #5
    100 Club tomcarver's Avatar
    Join Date
    2015-11
    Location
    Tucker, GA
    Posts
    106
    Login to Give a bone
    0

    Default Re: access toolbar button from keyboard

    Thanks Tom. I knew about 1 or 2 of these. The others will be handy. How do I get the fillet to repeat so I can fillet multiple lines with out having to hit enter?

    Tom

    - - - Updated - - -

    Big-AL,
    Thanks, can you show me where the while goes and what parentheses it needs?

    Tom

  6. #6
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,655
    Login to Give a bone
    0

    Default Re: access toolbar button from keyboard

    Quote Originally Posted by tomcarver View Post
    Thanks Tom. I knew about 1 or 2 of these. The others will be handy. How do I get the fillet to repeat so I can fillet multiple lines without having to hit enter?

    Tom
    While there are many ways to do it with a macro or lisp after starting FILET I simply click [Multiple] on the command line or hit keys "M" then "Spacebar".

Similar Threads

  1. Quick Access Toolbar
    By KMercier_C3D in forum AutoCAD Civil 3D - General
    Replies: 2
    Last Post: 2010-10-25, 02:31 PM
  2. Less access keyboard in some cases with SP3??
    By Martin P in forum Revit Architecture - General
    Replies: 0
    Last Post: 2009-10-27, 05:11 PM
  3. mouse and keyboard button assignment in 2007 GUI
    By cslarson in forum AutoCAD CUI Menus
    Replies: 1
    Last Post: 2008-01-25, 05:31 AM
  4. Would like Toolbar description to appear under toolbar button
    By danny.139703 in forum AutoCAD General
    Replies: 1
    Last Post: 2007-05-21, 05:47 PM
  5. Is there an easy way to have a Toolbar button call up another Toolbar?
    By jonathanschade in forum AutoCAD CUI Menus
    Replies: 5
    Last Post: 2007-04-12, 04:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •