Jump to content

Multi Radio Buttons.lsp 2

   (1 review)

1 Screenshot

About This File

Multiple Radio Buttons
 
Multiple Radio Buttons is a library routine that allows you to create as many Buttons of input as required (subject to Autocad limits) using a dialouge rather than the command line.

 

You can have horizontal or vertical buttons choice is yours 

 

Its use is intended where you want the user to pick one only of preset values it can be a number, a character or a whole word.

 

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 "Multi Radio Buttons.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 3 lines of code in any lisp to use.
(if (not AH:Butts)(load "Multi radio buttons.lsp"))         ; loads the program if not loaded already
(if (= but nil)(setq but 1))                     ; this is needed to set default button for user pick
(setq ans (ah:butts but "V"   '("A B C D " "A" "B" "C" "D" )))    ; V is for vertical H for horizontal layout    

In the example above the variable ans will have the button string value. 


(setq ans (ah:butts but "V"   '("Please choose " "Alpha" "Beta" "1" "2" "No words")))
Pick button 5  ans = "No words" 

The program resets the default button to last pick so click Ok, can be removed if not required.

 

Copy the 3 lines above to your command line to see how it works. There is extra examples in the top of the code how to use in your code. 

 

For programmers it is a replacement for the Initget function.

If you want further information or conversion of your code email info@alanh.com.au
 


What's New in Version 2   See changelog

Released

Spacing between lines modified. 

Text is now central.

Multi radio buttons-2.lsp


User Feedback

Recommended Comments

There are no comments to display.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Add a comment...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...