Hello all,
I am in some need of a lisp routine to be loaded for every drawing that will include two keyboard commands. I would like to have the cammands UI for unit inches and UF for units feet. I am wanting these to change the UNITS: length type to change to Fractional when UI is entered and Architectural when UF is entered.
Autocad 2013
Thanks you,
Jarred
Solved! Go to Solution.
Solved by scot-65. Go to Solution.
@jarredmonday wrote:Hello all,
I am in some need of a lisp routine to be loaded for every drawing that will include two keyboard commands. I would like to have the cammands UI for unit inches and UF for units feet. I am wanting these to change the UNITS: length type to change to Fractional when UI is entered and Architectural when UF is entered.
Autocad 2013
Thanks you,
Jarred
(defun c:UI () (setvar "LUNITS" 2)(alert "Units set to Inches. ")(princ))
(defun c:UF () (setvar "LUNITS" 4)(alert "Units set to Feet. ")(princ))
Place these lines in one of the following files that is declared in your support path:
ACAD.lsp
ACADdoc.lsp
MyMenu.mnl where "MyMenu" is the same name as your Main or Enterprise CUI.
If any of the above is not on your system, create at least one of these using notepad.
Be sure to save as shown above and place file in a declared support path folder.
For ACAD.lsp there are two switches that need to be checked - ACADLSPACDOC and LISPINIT.
Poor-man's alternative interface point is command APPLOAD, and select the startup suite button
(There is even yet one more third-party interface point inside the CUI editor).
I would also look into MODEMACRO, as you will instantly be able to see what units you are currently using. Also place inside the file of choice:
(defun c:UI () (setvar "LUNITS" 2)(setvar "USERS1" "Fractional Inches")(alert "Units set to Inches. ")(princ))
...
(setvar "USERS1" (if (= (getvar "LUNITS") 2) "Fractional Inches" "Architectural Feet")) ;<-can be expanded...
(setvar "MODEMACRO" "$(getvar,USERS1)") ;<--untested
???
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.