How to Initiate a Lisp and provide a user defined value at start vs asking for a user input

How to Initiate a Lisp and provide a user defined value at start vs asking for a user input

timothy_crouse
Collaborator Collaborator
350 Views
2 Replies
Message 1 of 3

How to Initiate a Lisp and provide a user defined value at start vs asking for a user input

timothy_crouse
Collaborator
Collaborator

Hello, could someone explain / show how the code below would be modified to accept a passed value at runtime inlieu of asking for a user input and if there is no passed value at runtime the alert box is displayed:

 

 

(defun C:OSP (/ osp)

(progn
(alert
(strcat
"OSNAP PROFILES:"
"\n1 = END, MID, PERP, CENTER, QUAD, GEO CENTER, INT, APP INT"
"\n2 = END, NEAR, CENTER, QUAD, TAN"
"\n3 = END, MID, PERP, NODE, INSERTION"
"\n4 = END, NEAR"
"\n5 = KITCHEN SINK"
) ; strcat
) ; alert
) ; progn

(setq OSPlist '(("1osp" 3255) ("2osp" 789) ("3osp" 203) ("4osp" 513) ("5osp" 7423)))
(initget "1osp 2osp 3osp 4osp 5osp")
(setq osp (getkword "\nOffset Profile [1osp/2osp/3osp/4osp/5osp]: "))

(progn
(setvar 'osmode (cadr (assoc osp OSPlist)))
(prin1)
) ; progn
) ; if

(princ)

0 Likes
351 Views
2 Replies
Replies (2)
Message 2 of 3

Kent1Cooper
Consultant
Consultant

See in the >other topic<.

Kent Cooper, AIA
0 Likes
Message 3 of 3

Sea-Haven
Mentor
Mentor

Like Kent just type Osnap set your preferred osnaps then do Osmode get a pen and paper write down the number.

 

(setvar 'osmode 47)

 Or just find a copy of my Multi Radio buttons took 1 minute to make below, the big hint is use a cond and the variable "BUT" holds the number of the button picked then use the setvar.

SeaHaven_0-1692258814218.png

 

0 Likes