Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Help Please: Lisp for adding commands

1 REPLY 1
SOLVED
Reply
Message 1 of 2
jarredmonday
330 Views, 1 Reply

Help Please: Lisp for adding commands

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

Please mark Accept as Solution if your question is answered. Kudos gladly accepted. ⇘
1 REPLY 1
Message 2 of 2
scot-65
in reply to: jarredmonday


@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.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost