Jump to content

Multiple Toggles.lsp 1.0.0

   (1 review)

1 Screenshot

About This File

Multiple Toggles is a library routine that allows you to create as many Toggles of input as required (subject to Autocad limits) using a dialouge rather than the command line. 
Its use is intended where you want the user to pick one or more values. It can be used where you want to run a number of functions, pick multiple values to be used.
It can be used in most lisp code with just a couple of lines of code, compared to a hard coded solution of around 50+ lines repeated every time you want to use a dcl. 
To use just save the "Multiple Toggles.lsp" to a directory that is included in you Autocad search path. If you need more information how to do this send an email to info@alanh.com.au  
It only requires 2 lines of code in any lisp to use.
(if (not AH:Toggs)(load "Multiple toggles.lsp"))
(setq ans (AH:toggs (list "Change blank for yes " "Blocks" "Dimension" "Hatch" "Images" "Viewports" )))

In the example above the variable ans will have the toggle Values 1 or 0 for a toggle clicked on eg ("1" "0" "1" "0" "1") depending on toggle selected.
If you want further information or conversion of your code email info@alanh.com.au

  • Like 1

User Feedback

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.


Jonathan Handojo

· Edited by Jonathan Handojo


A very nice and useful code that saves you many lines of typing out. A few improvements from my perspective:


  1. Localise the variable DCL_ID
  2. Localise the function MKV_LST within the AH:TOGGS function.
  3. Reverse your return. When I selected several checkboxes, the result returned from AH:Toggs is the reverse of what's selected. (Supposedly you selected "Dimensions" in the above example as well.


If you fix it up, I'll reconsider giving 5 stars ;)

Link to review
  • Create New...