Message 1 of 7

Not applicable
08-24-2021
07:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey Guys,
Quick question, is there a way for CAD to accept skipping a sub-option in a lisp if you provide the info up front? Essentially (per the example below) if I wanted to say "hello world" I could just type "greeting" and then "w". However if I'm familiar with the lisp and know the options already is there a way to type something like "greeting\w" in the command line and have it skip straight to the alert end result for the sub option? Obviously if this worked somehow I would like to continue the tree for more complicated lisps, example being "greeting\w\g\j" if said sub options existed.
(defun c:greeting ( / n1 )
(initget 1 "w f")
(setq n1 (getkword "GREET WHO?: [(W)orld/(F)riends] > "))
(cond
(
(eq n1 "w")
(alert "hello world!")
)
(
(eq n1 "f")
(alert "hello friends!")
)
)
(princ)
)
Solved! Go to Solution.