Manually turn snaps on during command, automatically turn off after 1 use

Manually turn snaps on during command, automatically turn off after 1 use

Anonymous
Not applicable
786 Views
2 Replies
Message 1 of 3

Manually turn snaps on during command, automatically turn off after 1 use

Anonymous
Not applicable

Hello,

 

I used to use the following snap customisations at my previous job and I'd like to customise my AutoCAD at my new job:

  1. All snaps are off by default
  2. During a command for either 2D or 3D I can press either:
    'F3' - Quadrant, Perpendicular, Tangent snaps
    'F4' - Endpoint, Midpoint, Center, Intersection snaps
    'F5' - Nearest snap
  3. Once I have used the snap by clicking my mouse, snaps are automatically turned off again. If I am in the middle of a command, e.g. 'polyline', I will have to click F4 after each mouse button press to activate the snaps again.

Do I need to create lisps for my 'F3', 'F4' & 'F5' keys? Or can this be done within AutoCAD (which I've tried but failed).

 

Cheers,

Hamish

0 Likes
787 Views
2 Replies
Replies (2)
Message 2 of 3

Moshe-A
Mentor
Mentor

@Anonymous  hi,

 

Yes you can do this with CUI command (no lisp is needed but you need to explore cui more)

in CUI dialog on the upper left pane go to Keyboard Shortcuts \  Shortcut Keys

 

moshe

 

0 Likes
Message 3 of 3

hencoop
Advisor
Advisor

If your command is invoked by autolisp then just insert the desired snap override into your command sequence.  It will remain active for the next selection only but if the command is repeated the overrides will be used again at that point in your sequence. 

e.g.

(WHILE ...
  ...
  (COMMAND "LINE" "qua,per,tan" ...)
  ...
)

 Also, you can preset the OSMODE in your code prior to any point input.  e.g.

(DEFUN C:XYZ ()
  (SETQ preXYZ_osmode (GETVAR "OSMODE"))
  (SETVAR "OSMODE" 1285); set the different osmodes via the dialog and then run (GETVAR "OSMODE") to see the integer for that setting... or look it up in OSMODE help.
  <... function ...>
  (SETVAR "OSMODE" preXYZ_osmode)
  (PRINC)
)

You can also switch your OSMODE between the original and temporary settings you need as many times as necessary and for as many different settings as required within your code.

AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
                        27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
                        8.6.52.0 AutoCAD Architecture 2024
0 Likes