Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/21/2024 in all areas

  1. kword is smart enough to know the options you wanted you just have type the letter that are only in that option that were set in the initget. For example this is how I used kword with a default option so the user can just hit enter if they wanted to pick No. but if they wanted the "yes" they could have type YES, Y, or even just E or S it would have picked the yes option since those letters aren't in No. (initget "Yes No") (setq rep (cond ((getkword "\nSave Drawing? [Yes/<No>]: ")) ( "No") ) ) With that many options and similar spellings it might be better to go the @BIGAL route and use a multi radio buttons. https://www.cadtutor.net/forum/topic/11657-options-within-a-lisp/?do=findComment&comment=633559 if your dead set on wanting to use kword just have multiple unique options. seems to clunky and hard to read imo. (initget "breakAll breakwoBjects breakObject breakWith breakTouching breakSelected B O W") (setq option (getkword "\nChoose an option [breakAll/breakwo[B]jects/break[O]bject/break[W]ith/breakTouching/breakSelected <A>]: ")) (cond ((= option "breakAll")) (setq f )) ;doesn't need a option since All is unique ((or (= option "B") (= option "breakwoBjects")) setq f)) ;if only B is type this option will be chosen ((or (= option "O") (= option "breakObject")) (setq f )) ((or (= option "W") (= option "breakWith")) (setq f )) ((= option "breakTouching")) (setq f )) ((= option "breakSelected")) (setq f )) (T (princ "\nInvalid option selected")) ) (princ) ) All that said id just use Cab's lisp.
    1 point
  2. CABS Breakall.lsp is close but will break the green lines as well if that is ok. breakall.lsp
    1 point
  3. ;;; toggle draw toolbar (defun c:tdtb ( / lst ) (vlax-for mnu (vla-get-menugroups (vlax-get-acad-object)) (vlax-for tlb (vla-get-toolbars mnu) (if (= (vla-get-visible tlb) :vlax-true) (setq lst (cons (vla-get-name tlb) lst))))) (if (member "Draw" lst) (command "-toolbar" "Draw" "Hide") (command "-toolbar" "Draw" "Show") ) )
    1 point
  4. Your welcome to use this replaces initget. There is examples at top of code, save the file to a support directory as you must use (load "multi radio buttons") (setq ans (ah:butts 1 "V" '("A B C D " "A" "B" "C" "D" ))) (setq ans (atoi (ah:butts 1 "V" '("Please choose " "10" "20" "30" "40" )))) Multi radio buttons.lsp
    1 point
×
×
  • Create New...