Introduction
In my last blog post, “AutoCAD OSMODE System Variable”, we covered how the OSMODE system variable controls which Object Snap (OSNAP) modes are active in AutoCAD and how to save favourite OSNAPs with a shortcut command. This post introduces a custom AutoLISP program that builds on OSMODE and remembers custom settings without further modifications or creating custom buttons.
Getting the program ready
If you’re new to AutoLISP, I recommend starting with the article AutoLISP and Visual LISP (AutoLISP) and one of my earlier blog posts, How to Add Custom AutoLISP Commands into AutoCAD’s Ribbon. These resources will help you get familiar with AutoLISP basics and customization. In short, AutoLISP is a programming language built into AutoCAD that lets users create custom commands and extend functionality.
You can download the AutoLISP program CustomObjectSnap.lsp from the attachments of this blog. Save the program in a local folder on your computer, such as C:\Users\YourUsername\Documents\AutoLISP\, or any other location where you keep AutoCAD files.
The next step is to load the AutoLISP program into AutoCAD. There are several ways to do this, but one of the most commonly used methods is the APPLOAD command. This allows you to manually select and load the program, which is explained in detail in the Tutorial: Creating, Loading, and Opening an AutoLISP File (AutoLISP)
For those looking to automate the process, one of my earlier blog posts, How to Add Custom AutoLISP Commands into AutoCAD’s Ribbon, provides a step-by-step guide on how to automatically load AutoLISP programs and integrate them directly into the AutoCAD ribbon for easier access.
Note: This is not an official Autodesk tool. It is a custom program I created to streamline OSNAP settings.
Custom Object Snap Lisp Commands
COS - Instantly applies your saved custom OSNAP settings
CONFIGOSNAP - Opens a dialog to configure and save your preferred settings into persistent memory.
How the COS Command Works
When the COS command is entered at the command line, the program reads your saved OSNAP settings from the Windows Registry. If this is your first time using the program and no settings exist yet, the program opens a greeting dialog box and asks for permission to create and save OSNAP preferences.
Once Continue is pressed, the Object Snap Defaults dialog opens to specify and update favourite OSNAP settings. Clicking the Update Defaults button stores these preferences in the Windows per‑user Registry at: HKEY_CURRENT_USER\Software\Autodesk\AutoLISP\Osnap.This ensures your custom settings persist across AutoCAD sessions and even computer restarts. Writing under HKEY_CURRENT_USER is a standard, per‑user practice that AutoCAD already uses to store preferences. It affects only the signed‑in profile and does not require admin rights. To update the defaults later, run the CONFIGOSNAP command to reopen the dialog.
Once valid settings are found, the program applies them by updating the OSMODE system variable with your default preferences. A feedback message is displayed on the status bar that shows exactly which object snap modes are now active.
With that, your shortcut is ready to be used across all drawings in AutoCAD. Whenever you come across a drawing that does not have your favourite OSNAP settings applied, simply type COS and all default preferences will be applied.
Version History and Future Updates
The current version provides essential functionality for setting a quick shortcut for preferred OSNAP settings. Based on user feedback, future updates may bring additional features and improvements.
Please report any bugs or suggestions for new functionality by commenting below or sending me a personal message. Your feedback is invaluable and will help improve this tool for the entire community.
Version History:
Initial Release – September 22, 2025
I hope that the CustomObjectSnap program proves to be a helpful addition to your AutoCAD workflow. Thank you for trying out the program, and I look forward to hearing how it has helped you streamline your work!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.