Message 1 of 14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Looking to update my auto fillet lisp command shown below
(defun c:r5 (/ ofr r e1)
(setq ofr (getvar "filletrad"))
(if (= r1 nil)
(setq r1 10.0)
)
(princ "\n Bend radius < ")
(princ r1)
(princ " >?:")
(setq r (getdist))
(if (= r nil)
(setq r r1)
)
(setq r1 r)
(princ "\n Start polyline: ")
(command "._pline")
(while (= 1 (logand (getvar "CMDACTIVE") 1))
(command PAUSE)
)
(setq e1 (entlast))
(setvar "filletrad" r)
(command "fillet" "p" e1)
(setvar "filletrad" ofr)
(princ)
)
But what I am looking to do on first run of the lisp to ask user for Fillet Radius. But to remember the that value when you run R5 the next time. But have an option to type R for arc radius to change it if you want a different arc radius.
I have a similar command that does this with centered text but for the life of me cant figure out how to merge that code with the R5 command to get it to work... Below is the text command that request text height on first run and remembers it until you type H to change the text height. Basically need R5 lisp to work similar to this one below but not with text haha!
(defun c:textmc (/ getht startpoint)
(defun getht ()
(initget 6); no 0, no negative
(setq *tmcht ; global variable
(cond
( (getdist ; [returns nil on Enter]
(strcat
"\nText Size <"
(rtos (cond (*tmcht) (0.0625))); 1/16 initial default if not yet set
">: "
); strcat
); getdist
); User-input condition
(*tmcht); Enter with prior value
(0.0625); Enter on first use [initial default]
); cond
); setq
); defun -- getht
(setvar 'textstyle "STANDARD")
(while (not (member '(40 . 0.0) (tblsearch "style" (getvar 'textstyle))))
(alert "Set a non-fixed-height Style current.")
(initdia)
(command "_.style")
); while
(if (not *tmcht) (getht)); if no prior value
(initget "Height")
(while
(=
(setq startpoint
(getpoint
(strcat
"Current height = "
(rtos *tmcht)
". Enter Middle-Center Point or [Height]: "
); strcat
); getpoint
); setq
"Height" ; [User chose H option]
); =
(getht)
(initget "Height"); for possible repeat H options
); while
(command "_.dtext" "_mc" startpoint *tmcht "0")
(setvar 'textstyle tsty); reset what was current before
(princ); [so it doesn't put the reset Text Style name at the Command: line]
); defun -- textmc
Solved! Go to Solution.