TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: mkweaver on July 01, 2015, 02:57:35 PM

Title: Is the block editor active?
Post by: mkweaver on July 01, 2015, 02:57:35 PM
I have a reactor running that logs the file name and time when I save my drawing (I use the log as a reminder of what I worked on when I do my time sheet).  However, if I'm in the block editor I would like it to include the name of the block.

How can I tell if the block editor is active?

I thought I might check to see if the "Block Editor" ribbon tab was showing on the ribbon, but it looks like it takes .NET to do that.

I wondered about checking the window caption, but that doesn't change in the block editor.

Suggestions appreciated.
Title: Re: Is the block editor active?
Post by: ronjonp on July 01, 2015, 03:21:07 PM
Code - Auto/Visual Lisp: [Select]
  1. ;; Block editor active
  2. (= 1 (getvar 'blockeditor))
Title: Re: Is the block editor active?
Post by: mkweaver on July 01, 2015, 03:44:42 PM
So simple.

Thanks!

Now I have to figure out how to get the name of the block I'm editing.  http://adndevblog.typepad.com/autocad/2015/03/identify-the-block-editing-mode-in-autocad.html (http://adndevblog.typepad.com/autocad/2015/03/identify-the-block-editing-mode-in-autocad.html) explains how to do it in .NET, but I don't see anything for lisp.