Author Topic: Custom Osnap  (Read 2732 times)

0 Members and 1 Guest are viewing this topic.


  • Guest
Custom Osnap
« on: April 08, 2010, 09:18:20 PM »
With acad 2009 (or other)
How do I detect when activated or deactivated custom osnap's (CustomObjectSnapMode)?

For me, does not work with CustomObjectSnapMode, CommandWillStart, Command... events.

Thanks (sorry, i do not speak english).


  • Gator
  • Posts: 2522
  • Marseille, France
Re: Custom Osnap
« Reply #1 on: April 09, 2010, 03:37:41 AM »

CustomOsnaps work the same way as native osnaps.
You can managed the activation with a registered 'custom sysvar'.

You can get some inspiration from this thread (source code for a single solution for different target versions for AutoCAD here).
In the Commands class, a command (CUSTOSMODE) and 2 LISP functions (gc-GetCustOsmode and gc-SetCustOsmode) allows the user to activate/deactivate osnaps.
Speaking English as a French Frog


  • Guest
Re: Custom Osnap
« Reply #2 on: April 09, 2010, 12:49:08 PM »
Thanks, I know your code. My ( code is a copy of yours,
In AutoCAD 2009 you can turn on/off the custom osnaps from a menu (right click on statusbar "osnap" button) and does not fire any event and i would like to know when they are activated or deactivated.

For if it helps someone:
I sent the code. Is your code (converted to with some modifications.