Thread Content
Since I often use orthogonal commands, it is inconvenient to press F8 with my left hand. Please tell me how to replace the orthogonal command F8 with the shortcut key number 3, etc.? And also change F5 to numbers? Thanks!
(defun c:f3() ;This program was designed by Comrade Dragon to convert orthogonal mode, which is equivalent to F8. (setq pt1 (getvar "ORTHOMODE")) (if (= pt 1) (progn (setvar "ORTHOMODE" 0) (setq pt 0) ) (progn (setvar "ORTHOMODE" 1) (setq pt 1) ) ) (print) ) (prompt "It was drawn by Dragon! Enjoy it! ") Okay. Save this file as f3.lsp and place it in a directory supported by your cad. Enter when using: (load "f3.lsp") After successful loading, enter f3, just like you use F8. The shortcut key f3 can also be changed to other shortcut keys of your own choice. but: The shortcut key cannot be defined as 3, otherwise when you enter numbers in the future, cad will think that you are calling the shortcut key. You will never enter 3 in this life. You can't input it like this.: RMB 45.32 yuan. Please pay attention to this problem when defining shortcut keys. This post was last edited by fl202 on 2009-2-5 14:27 ]
There is no need to change to numeric keys, otherwise it may cause greater inconvenience.
Support the statement above. It is really troublesome to switch orthogonally frequently. I usually use polar tracking so that I can track the orthogonal direction without switching.
It is not recommended to use it. If you must use it and don't find it annoying, you can do this.: (defun C:3 () (command "ortho""on")) (defun C:4 () (command "ortho""off"))
So if I want orthogonality while drawing a straight line, but orthogonality is not turned on at this time, can I enter a command (except F8) to achieve orthogonality while drawing a straight line? Thank you!
So as I said before, it is not recommended to use it. I also know the problem you mentioned, but I haven't found a way yet. I will tell you when I think of how to do it!
A small suggestion: since you have uploaded the source code, don’t add some personal information to avoid misleading some people who are just learning programming! for example: (prompt "It was drawn by Dragon! Enjoy it! ")
It's very simple. In this case, you just hold down the shift key, which is equivalent to F8. For example, if orthogonal is not turned on now, I want to draw a horizontal straight line. There is no need to turn on orthogonal at this time. Enter command L, select the first point, hold down shift, select the second point, and a horizontal straight line will appear. By the same token, this method can also draw non-horizontal or vertical lines or other objects in orthogonal mode. Try it yourself.
I personally don't think so. On the contrary, adding these things can remind users: This kind of small program was developed by others, not CAD itself. Why can it do this and how to achieve its functions? I want to learn * Down. And there's another benefit: I just want to make a publicity for lisp, so that people who don’t understand can see what this article is used for, and it can inspire others to learn. * interest.
Personally think: It's not good for you to program like this. first: Since the function is one, then in the end we will write one program instead of two. in addition: Orthogonal transformation should be a transformation of the existing orthogonal mode, rather than a hard change regardless of the existing mode. at last: "Ortho" and "off" should be typed as "ortho" and "off" with a larger space in between. Otherwise, it will be difficult for people who don't understand to find that a space is needed in the middle, and it will be very difficult for him to debug.
This method is currently a better solution. I tried it myself. If you are not currently in orthogonal mode, press and hold to make it orthogonal. ; If you are in orthographic mode, you can draw at will by pressing and holding the shift key. When selecting objects, you can also kick out some unwanted objects, which is very useful.