Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic snap in Acad2000

Status
Not open for further replies.

xyzz

Electrical
Mar 14, 2003
126
Is there a way in Acad2000 to control the snap On/Off automatically as follows?
- On command entry the snap should go Off.
- When objects selection is done the snap should go On.
In both cases it should be possible to alter the snap status manually.
 
Replies continue below

Recommended for you

Other than the way AutoCAD handles snapping, the only thing you could do is toggle the F3 button. I am assuming you meant OSNAP by the way.

"Everybody is ignorant, only on different subjects." — Will Rogers
 
You can use a short LISP program, like this one. It turns snap off and and ortho on, then runs the MOVE command, then sets snap and ortho back the way they were. This one is called OM and is part of my acad.lsp file. I use it by typing OM on the command line. Alternaltly, it could be asigned to a button or menu pull down or in the POP0 Ctrl-click menu.

(DEFUN C:OM ( / CM OM OT P) ; Move, NONE, Ortho on
(setq CE (getvar "cmdecho")
OM (getvar "osmode")
OT (getvar "orthomode"))
(setvar "cmdecho" 0)
(setvar "orthomode" 1)
(setvar "osmode" 0)
(setq P (ssget))
(COMMAND "MOVE" P "" PAUSE PAUSE)
(setvar "cmdecho" CE)
(setvar "orthomode" OT)
(setvar "osmode" OM)
(princ)
)
 
I meant general snap (F9).

IFR, where should I write this program?
Thank you for reply.
 
xyzz - To save the current F9 setting, use (setq SM (getvar "snapmode") and to set it off use (setvar "snapmode" 0) and to turn it on use (setvar "snapmode" 1) and to return it to the saved condition use (setvar "snapmode" SM).

Write the routine inside your acad.lsp file. Use a pure ASCII text editor like Notepad. Do NOT use Word unless you know how to save it as pure text!!! Word will mess it up!!!
 
There is no Acad.lsp file in my computer :(
 
Doyo uby any chance have a version of Autocad LT??? If not, this won't sork because LT does not support Lisp.

Else, create this file by copy and paste into Notepad (Start/Run "Notepad"[ENTER]), save it as OM.lsp (or whatever). Save it in C:\ (or wherever)

In Autocad, type (load"C:\\om.lsp")
The you can type "OM" without the quotes on the Autocad command line and it will start.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor