Author Topic: Blockview Control problem  (Read 7212 times)

0 Members and 1 Guest are viewing this topic.


  • Swamp Rat
  • Posts: 851
Blockview Control problem
« on: June 03, 2008, 10:23:00 AM »
AutoCAD Architecture 2009
WinXP Pro (32)

the scenario:
Modeless form with a blockView control, AutoCAD set to Multi Document Mode, more than one drawing opened.  When the active document is closed, if the blockView control is dispaying a block AutoCAD will crash: Fatal Error.  If the control is clear, i.e. not displaying a block, everything is fine.  So I came up with this work-around which basically clears any blockView controls on any floating modeless forms during the vlr-BeginClose event of a VLR-Dwg-Reactor.

If your experiencing the same problem try the following.  Just change the form variables in the jb:BeginClose callback function.

Code: [Select]
;;; BeginClose ;
 (defun jb:BeginClose(calling-reactor event / )
   (if (dcl_Form_IsActive jb006_00)
    (dcl_BlockView_Clear jb006_00_BlockView1))
(if (dcl_Form_IsActive jb003_00)
    (progn(dcl_BlockView_Clear jb003_00_DwgView)
      (dcl_BlockView_Clear jb003_00_BlockView)
   (if (dcl_Form_IsActive jb004_00)
    (dcl_BlockView_Clear jb004_00_BlockView))

;;; Construct the BeginClose Reactor ;
(defun jb::ConstructBeginCloseReactor  (/)
  (if (= (type *jbBeginCloseReactor*) 'VLR-Dwg-Reactor)
    (progn (vlr-remove *jbBeginCloseReactor*) (setq *jbBeginCloseReactor* nil)))
  (if (/= (type *jbBeginCloseReactor*) 'VLR-Dwg-Reactor)
    (setq *jbBeginCloseReactor*
             "jbTools Begin Close Event Reactor" ; Data associated with the editor reactor
             ;; call backs
              ((:vlr-beginClose . jb:BeginClose)
               )) ;_ end of vlr-editor-reactor

  (if (not (vlr-added-p *jbBeginCloseReactor*))
    (vlr-add *jbBeginCloseReactor*)
    (vlr-set-notification *jbBeginCloseReactor* 'active-document-only)));added 09.26.2003

;;; load reactors ;

(if jb::ConstructBeginCloseReactor

James Buzbee
Windows 8