How to create a custom command?

How to create a custom command?

Anonymous
Not applicable
1,342 Views
5 Replies
Message 1 of 6

How to create a custom command?

Anonymous
Not applicable

Hi everyone!

I always make a mistake of toggling around my plans by clicking the wheel and pressing the shift key.

so everytime i make such mistake i have to change my view to top view.

 

wanting to save time, i would like to create a command like below;

 

input:   "TT"

output:     -view    ->   orthographic    ->    top

ive been searching online how to make this happen

but its been a month only for me to use autocad

 

please help me and save my future architecture assignments 😉

0 Likes
1,343 Views
5 Replies
Replies (5)
Message 2 of 6

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> -view -> orthographic -> top

isn't it easier to use the viewcube or the viewport controls?

No need to define anything, works well with AutoCAD OOTB

 

20190919_111529_0001.png

 

If you need the command, then:

(defun C:TT()(command "_-VIEW" "_ORTHOGRAPHIC" "_TOP"))

This defines the command as LISP statement, ready to be called then with

TT<ENTER>

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 3 of 6

Anonymous
Not applicable

your suggestion is good as well but switching from keyboard to mouse takes longer time to save time

i followed your instruction and worked really well

but how do i add such custom sequence to aliasedit thing??? that i can use such sequence everytime i use autocad???

0 Likes
Message 4 of 6

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> but how do i add such custom sequence to aliasedit thing???

>> that i can use such sequence everytime i use autocad???

Add this line into the existing ACADDOC.LSP, if you don't have such a file, then create a new one (>>>details<<<).

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 5 of 6

illusionistNUGXG
Advocate
Advocate

You can create a keyboard shortcut for that with the customer user interface.

 

How to do:

(sorry, the pictures are made with the german version of AutoCAD Mechanical 2019)

 

  1. open the CUI
  2. create a new command (pictute CUI-1.png)
  3. fill in “top view” as name - or whatever you like (picture CUI-2.png)
  4. copy & paste the macro into the macro-field
  5. open “keyboard commands” (i guess it should be named something like that)
  6. drag and drop the new command into “keyboard shortcuts” (picture CUI-3.png)
  7. the command is now in that list - click on it, and assign a shortcut - shift+T or F12 for example*. Don’t write it in - use the [...]-button! (picture CUI-04 - oh, limit is 3 pictures...next post)
  8. apply - of course

 

Now you can change to the top view with your keyboard.

* i never changed any aliases for commands, so i can't give further instructions to assign it as "TT"-command.

 

The macro is:

^C^C_-view;_orthographic;_top

Message 6 of 6

illusionistNUGXG
Advocate
Advocate

picture 4:

0 Likes