HomeHome BlogBlog TwitterTwitter YouTubeYouTube ContactContact

OsnapzBG freeware for OSNAPZ in AutoCAD

About | Download | System requirements
Documentation | License agreement | Customers


When the AutoCAD variable OSNAPZ is changed many have found it useful to have a more visual change to indicate its state. In verticals like AutoCAD Architecture you have a small button that indicates the state of the “Z lock” but some might want to even have the background color change just like the Block Editor changes the background color.

With OsnapzBG loaded any change of OSNAPZ will also change the background and other specified colors depending on if OSNAPZ is set to 0 or 1.

The four colors that are saved and changed are:
*Model Space Crosshair Color
*Model Space Background Color
*Model Space Autotrack Vector Color
*Model Space Autosnap Marker Color

I have made this background color changer for OSNAPZ app available as a freeware.

If you find it useful I would appreciate any contribution. Here is a PayPal link (credit cards also accepted) you can use and enter 1 EUR or more as Unit Price.

Here is what it look like in AutoCAD Architecture. “Replace Z value with current elevation” is a button on the application status bar.

It is the system variable OSNAPZ that holds this setting. OSNAPZ was introduced in AutoCAD 2006 and with OSNAPZ set to 1 anything you snap to only uses the current elevation as z value. OSNAPZ controls whether object snaps are automatically projected onto a plane parallel to the XY plane of the current UCS at the current elevation. OSNAP command or OSMODE system variable in AutoCAD sets running object snap modes.

When installed as an AutoCAD app OsnapzBG shows up on the Plug-ins tab and gives quick access to also change the value of OSNAPZ.



For AutoCAD 2012 and newer download OsnapzBG as an AutoCAD app on Autodesk Exchange Apps site.

Download OsnapzBG.zip here if you have AutoCAD 2011 or older.

Jump to the documentation section.

System requirements

Compatible with AutoCAD 2009, AutoCAD 2010, AutoCAD 2011, AutoCAD 2012, AutoCAD 2013, AutoCAD 2014, AutoCAD 2015 and AutoCAD 2016. All flavors based on AutoCAD should be working like AutoCAD Architecture (ACA), AutoCAD Civil 3D, AutoCAD Electrical , AutoCAD Map 3D, AutoCAD Mechanical, AutoCAD MEP (AMEP, ABS), AutoCAD P&ID, AutoCAD Plant 3D.

Compatible with those operating systems AutoCAD runs on like Windows Vista, Windows 7, Windows 8 and Windows 8.1.
Older Windows versions might also work but are not directly supported.


Installation of the AutoCAD plug-in

This option is available for AutoCAD 2013-2016 and 2013-2016 verticals. This can be done both while AutoCAD is running or not running.
Enter the below path in Windows Explorer address field and press enter.
Extract OsnapzBG.bundle.zip in the ApplicationPlugins folder so that a folder named OsnapzBG.bundle is created with all needed files.
It can look like this where jtb is an example of the user name.
PackageContents.xml should be found in the OsnapzBG.bundle folder.
To uninstall, delete the OsnapzBG.bundle folder.

Jump to the usage section.

Another Installation Option

Download OsnapzBG.zip and extract the files to a folder of your choice.

Notice though that you should have it on your local PC or special .NET security settings needs to be done. An error message indicating this can be something like: Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

OsnapzBG.dll (name of dll is depending on version) needs to be loaded by your AutoCAD application and that can be done in different ways. Use one of the following options.

  • Use the command NETLOAD and select OsnapzBG.dll. This loads the command in the current session only.
  • Create a menu command, toolbar button or palette tool using CUI and force load it before running the command.
    Macro or Command string:
    ^c^c(command "netload" "C:/Program Files/JTB World/OsnapzBG/OsnapzBG.dll");
  • Add the row below to your acad.lsp file so it loads automatically when AutoCAD starts.
    (command "netload" "C:/Program Files/JTB World/OsnapzBG/OsnapzBG.dll")

Solution to the following error is to right click on the DLL file and click on Unblock.

Cannot load assembly. Error details: System.IO.FileLoadException: Could not
load file or assembly 'file:///C:\Users\JTB\AppData\Roaming\JTB
World\Osnapzbg\Osnapzbg.dll' or one of its dependencies. Operation is not
supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Users\JTB\AppData\Roaming\JTB
World\Osnapzbg\Osnapzbg.dll' ---> System.NotSupportedException: An attempt
was made to load an assembly from a network location which would have caused
the assembly to be sandboxed in previous versions of the .NET Framework. This
release of the .NET Framework does not enable CAS policy by default, so this
load may be dangerous. If this load is not intended to sandbox the assembly,
please enable the loadFromRemoteSources switch. See
http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String
codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint,
StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean
forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName
assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean
forIntrospection, Boolean suppressSecurityChecks)
at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile,
Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm
hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks,
StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
at loadmgd()

See also more details here: Solution to System.IO.FileLoadException Could not load file or assembly error


Make the background color you want to use for OSNAPZ=0 and run the SetOsnapzColors0 command or use the button on the Ribbon tab Plug-ins.

Make the background color you want to use for OSNAPZ=1 and run the SetOsnapzColors1 command or use the button on the Ribbon tab Plug-ins.

The four colors that are saved and changed are:
*Model Space Crosshair Color
*Model Space Background Color
*Model Space Autotrack Vector Color
*Model Space Autosnap Marker Color

Now when OSNAPZ is changed the background will change accordingly.

OSNAPZ set to 0

OSNAPZ set to 1 - This will replace Z value with current elevation.

Revision History

  • 2015-03-20 - version 1.2 update

    • Added support to AutoCAD® 2016. (No version number change)
      Added digital signing of DLL and installer files

  • 2014-04-02 - version 1.2

    • Updated installer for the Autodesk App version to support AutoCAD 2015 and verticals.
      Minor fixes so the colors also change when needed upon application startup.

  • 2013-04-13 - version 1.1 update

    • Support for AutoCAD 2014. To upgrade delete the existing OsnapzBG.bundle folder first.

  • 2012-05-07 - version 1.1

    • Support for AutoCAD 2013.

  • 2009-04-26 - version 1.0

Contact us for any questions, wishes or comments.

© 2001-2015 JTB World. All rights reserved.