I use FILLET extensively in any drafting session and when it comes to rebar bend with a radius, it's troublesome to set the radius of FILLET to different values time and again, so I wrote a few lines to create new FILLET commands that are mapped to the radius I desired.
The code below is a modified FILLET command -- completed with error-trapping function -- called F15, which is a FILLET command that has a 15-unit radius. The routine stores the existing FILLET radius value, substitutes it with 15 in the process and restores the existing value at the end.
(defun errF15 (message)
(command)
(setvar "filletrad" frad)
(setq *error* localErrorF15)
(prompt "\nRoutine cancelled. ")
(princ)
)
(C:F15 (/ localErrorF15 frad)
(setq localErrorF15 *error*)
(setq *error* errF15)
(setq frad (getvar "filletrad"))
(command "._FILLET" "R" "15" "._FILLET" pause pause)
(setvar "filletrad" frad)
(setq *error* localErrorF15)
(princ)
)
(command)
(setvar "filletrad" frad)
(setq *error* localErrorF15)
(prompt "\nRoutine cancelled. ")
(princ)
)
(C:F15 (/ localErrorF15 frad)
(setq localErrorF15 *error*)
(setq *error* errF15)
(setq frad (getvar "filletrad"))
(command "._FILLET" "R" "15" "._FILLET" pause pause)
(setvar "filletrad" frad)
(setq *error* localErrorF15)
(princ)
)
And yes, by replacing all the 15s in the code with 20s, you'll have a F20 command. ;-)
No comments:
Post a Comment