<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Make a reactor that once a dynamic block visibility is changed explode and purge block. in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11884305#M32768</link>
    <description>&lt;P&gt;Again I am missing something I understand the passing to the defun but what is reactor ?? Or is it that my code is incorrect.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In another reactor code I have&amp;nbsp;(defun fillet-reactor-callback ( obj com ) and yes I look at what is in com.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Short version try in any dwg with a block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun VFTREMOVE1 (reactor / ssvft efname blk)
(princ "running")
(if (tblsearch "Block" "CLIENT IMG")
  (progn
  (setq ssvft (ssget "X" '((0 . "INSERT")(2 . "CLIENT IMG"))))
  (if ssvft
  (mapcar '(lambda (ent) (vla-Delete (vlax-ename-&amp;gt;vla-object Ent)))
  (vl-remove-if-not '(lambda (x) (= (type x) 'ename)) (mapcar 'cadr (ssnamex ssvft))))
  )
  )
)
(setq CLOSEDWG nil)
)
(or vft-reactor-acdoc
    (setq vft-reactor-acdoc (vla-get-activedocument (vlax-get-acad-object)))
)
(setq CLOSEDWG (vlr-dwg-reactor "VFTREM" '((:vlr-beginclose . VFTREMOVE1))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Apr 2023 02:57:30 GMT</pubDate>
    <dc:creator>Sea-Haven</dc:creator>
    <dc:date>2023-04-10T02:57:30Z</dc:date>
    <item>
      <title>Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11841542#M32758</link>
      <description>&lt;P&gt;Hope the title makes sense I have been asked for very cad illiterate that if they change the visibility of a dynamic block from default to another state that the block is exploded and then purged. The idea is that the block no longer exists but its state does.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any body have any idea if it is even feasible. I am a beginner when it comes to reactors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think the following would be the way to go, checking both of them.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;:vlr-beginClose
:vlr-beginSave&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make life harder the dynamic block is part of a layout in another dwg. So user can do a Layout T "Layoutname" so this loses say the handle ID. The only common item is block name and hopefully there is only one in dwg.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 10:02:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11841542#M32758</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-03-23T10:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11843974#M32759</link>
      <description>&lt;P&gt;Following on have come up with this to get around user input loaded on start up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(vl-load-com)
(defun REMOVE1 ( / )
  (setq CLOSEDWGX nil)
  (princ "closing xxx")
  (vl-cmdf "-purge" "B" "IMG" "N")
)
(setq CLOSEDWGX (vlr-dwg-reactor nil '((:vlr-beginclose . REMOVE1))))
(defun REMOVE2 ( / )
  (setq SAVEDWGX nil)
  (princ "saving xxx")
  (vl-cmdf "-purge" "B" "IMG" "N")
)
(setq SAVEDWGX (vlr-dwg-reactor nil '((:vlr-beginsave . REMOVE2))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Works in Bricscad but Autocad comes up with a message about "to many variables" which I am sure is associated with the purge.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 03:32:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11843974#M32759</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-03-24T03:32:56Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11845335#M32760</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp; hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; :vlr-beginSave&amp;nbsp; require the callback function to have 2 arguments.&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; i'm not sure but think running (vl-cmdf) or (command) is &lt;EM&gt;not&lt;/EM&gt; allowed in callback.&lt;/P&gt;&lt;P&gt;3.&amp;nbsp; always check for reactor validate before installing it&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;enjoy&lt;/P&gt;&lt;P&gt;Moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun REMOVE2 (obj fname)
  (setq SAVEDWGX nil)
  (princ "saving xxx")
  (vl-cmdf "-purge" "B" "IMG" "N")
)


(if (not SAVEDWGX)
 (setq SAVEDWGX (vlr-dwg-reactor nil '((:vlr-beginsave . REMOVE2))))
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 15:13:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11845335#M32760</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2023-03-24T15:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11846318#M32761</link>
      <description>&lt;P&gt;Thanks yes needs 2 items for defun I used (setq fname (getvar 'dwgname)) outside of the reactor defun so it exists, but OBJ ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am struggling to find examples of VLR-Beginsave only 1 I found had similar pass 2 variables but no mention of what they were.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 00:43:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11846318#M32761</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-03-25T00:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11846688#M32762</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MosheA_1-1679728781513.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1193360iEC6D1199F28AD8A7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MosheA_1-1679728781513.png" alt="MosheA_1-1679728781513.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 07:20:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11846688#M32762</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2023-03-25T07:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11846811#M32763</link>
      <description>&lt;P&gt;Thanks Moshe-A but what is a "database object to save at" ? Just no help anywhere I have been googling and searching. the example I found&amp;nbsp; of using save have the same 2 random variables but what are they ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am going around in circles trying all sorts of combos for the values of obj&amp;nbsp;&lt;/P&gt;&lt;P&gt;(vla-get-activedocument (vlax-get-acad-object))&lt;/P&gt;&lt;P&gt;(vlax-get-acad-object)&lt;/P&gt;&lt;P&gt;or is it the block object ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The file name is not being read also.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 09:29:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11846811#M32763</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-03-25T09:29:08Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11847433#M32764</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6254908"&gt;@Sea-Haven&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;think i have it now&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&amp;nbsp; (&lt;SPAN&gt;the documentation is not accurate)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;the first argument is the reactor&lt;/P&gt;&lt;P&gt;the second is a list with 2 items&lt;/P&gt;&lt;P&gt;the first item is AcadDatabase (which is a bit different from AcadDocument see documentation)&lt;/P&gt;&lt;P&gt;the second item is the name of current temporary dwg file which AutoCAD work on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Moshe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun REMOVE2 (reactor lst)
  (terpri)
  (vlax-dump-object (car lst) t)
  (princ fname)
  (terpri)
  (setq SAVEDWGX nil)
  (princ "saving xxx")
  (vl-cmdf "-purge" "B" "IMG" "N")
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 Mar 2023 18:35:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11847433#M32764</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2023-03-25T18:35:51Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11849211#M32765</link>
      <description>&lt;P&gt;Thanks Moshe-A will have a play, trying to get client to use a autoloaded lisp rather than relying on a reactor. That sets the dynamic block explodes and purges so all done.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Mar 2023 23:44:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11849211#M32765</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-03-26T23:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11879442#M32766</link>
      <description>&lt;P&gt;Still trying to get this to work getting closer but just missing soemthing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun REMOVE1 ( / ssvft efname blk)
(if (tblsearch "Block" "CLIENT IMG")
  (progn
  (setq ssvft (ssget "X" '((0 . "INSERT")(2 . "CLIENT IMG"))))
  (if ssvft
  (mapcar '(lambda (ent) (vla-Delete (vlax-ename-&amp;gt;vla-object Ent)))
  (vl-remove-if-not '(lambda (x) (= (type x) 'ename)) (mapcar 'cadr (ssnamex ssvft))))
  )
  )
)
(setq ssvft (ssget "X" (list (cons 0  "INSERT")(cons 2 "**U*"))))
(if ssvft
  (repeat (setq x (sslength ssvft))
    (setq blk (vlax-ename-&amp;gt;vla-object (ssname ssvft (setq x (1- x)))))
    (setq efname (vla-get-effectivename blk))
    (if (= efname "CLIENT IMG")
    (vla-delete blk)
	)
  )
)
(vla-sendcommand reactor-acdoc "-purge B CLIENT IMG \nN\n")
(setq CLOSEDWG nil)
)
(or reactor-acdoc
    (setq reactor-acdoc (vla-get-activedocument (vlax-get-acad-object)))
)
(setq CLOSEDWG (vlr-dwg-reactor nil '((:vlr-beginclose . REMOVE1))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 07:13:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11879442#M32766</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-04-07T07:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11879742#M32767</link>
      <description>&lt;P&gt;Reactors are events in AutoCad that trigger functions. Instead of manually executing functions, you can set up different events that will. You can add multiple types of reactors that trigger multiple different functions, or even the same function. You could add the same reactor multiple times, so you should be careful when dealing with reactors.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;;Reactor callback function
(defun BeginCloseFunc (reactor lst)
;Your code goes here
)

;if the reactor does not exist, create it
(if (not _BeginCloseReactor) (setq _BeginCloseReactor (VLR-Dwg-Reactor nil '((:VLR-beginClose . BeginCloseFunc)))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To set up a reactor, you need to specify the reactor type, the event you are waiting for and the function to be executed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;(ReactorType nil '((Event . FunctionToBeExecuted)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One more thing:&lt;/P&gt;&lt;PRE&gt;(vla-get-activedocument (vlax-get-acad-object))&lt;/PRE&gt;&lt;P&gt;This is the active document object. It has nothing to do with the reactors. If you need to use it, you can simply add it as a local variable inside your function.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 10:13:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11879742#M32767</guid>
      <dc:creator>doaiena</dc:creator>
      <dc:date>2023-04-07T10:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11884305#M32768</link>
      <description>&lt;P&gt;Again I am missing something I understand the passing to the defun but what is reactor ?? Or is it that my code is incorrect.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In another reactor code I have&amp;nbsp;(defun fillet-reactor-callback ( obj com ) and yes I look at what is in com.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Short version try in any dwg with a block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun VFTREMOVE1 (reactor / ssvft efname blk)
(princ "running")
(if (tblsearch "Block" "CLIENT IMG")
  (progn
  (setq ssvft (ssget "X" '((0 . "INSERT")(2 . "CLIENT IMG"))))
  (if ssvft
  (mapcar '(lambda (ent) (vla-Delete (vlax-ename-&amp;gt;vla-object Ent)))
  (vl-remove-if-not '(lambda (x) (= (type x) 'ename)) (mapcar 'cadr (ssnamex ssvft))))
  )
  )
)
(setq CLOSEDWG nil)
)
(or vft-reactor-acdoc
    (setq vft-reactor-acdoc (vla-get-activedocument (vlax-get-acad-object)))
)
(setq CLOSEDWG (vlr-dwg-reactor "VFTREM" '((:vlr-beginclose . VFTREMOVE1))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 02:57:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11884305#M32768</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-04-10T02:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11884667#M32769</link>
      <description>&lt;P&gt;hey,&lt;/P&gt;&lt;P&gt;reactor is resident trigger, programmed to a certain event and having caught the latter running a corresponding program&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 08:47:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11884667#M32769</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-04-10T08:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11884677#M32770</link>
      <description>&lt;P&gt;That does not mean anything to me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a fully working code example. Not explanations. Just make it erase a block in the dwg and purge occurrences of it from the dwg when saving or closing. The requirement is that users have no input or else would use a custom command. Which is easy to do. Its about a proprietary dynamic block.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am sure its so simple what I am missing I have spent hours on this. Anybody that sees my name on post will realise I am really stuck with something I have no idea how to solve and I don't get stuck often.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 08:56:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11884677#M32770</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-04-10T08:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11884713#M32771</link>
      <description>&lt;P&gt;and what is prospect scenario? in first post you said it should check if visibility state in dynamic block was changed... in what you are writing now it is somewhat different.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 09:28:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11884713#M32771</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-04-10T09:28:59Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11884805#M32772</link>
      <description>&lt;P&gt;I haven't tested the code, but it should work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;;Reactor callback function
(defun BeginCloseFunc (reactor lst / blocks)

(if (setq blocks (ssget "X" '((0 . "INSERT"))))
(progn
(vl-cmdf "erase" blocks "")
(vl-cmdf "-purge" "B" "" "N")
))

(cond
((= (vlr-current-reaction-name) ':VLR-beginSave) (alert "This function has been triggered by a Document Save event."))
((= (vlr-current-reaction-name) ':VLR-beginClose) (alert "This function has been triggered by a Document Close event."))
)

(princ)
);defun

;if the reactors do not exist, create them
;note that both reactors use the same function
(if (not _BeginCloseReactor) (setq _BeginCloseReactor (VLR-Dwg-Reactor nil '((:VLR-beginClose . BeginCloseFunc)))))
(if (not _BeginSaveReactor) (setq _BeginSaveReactor (VLR-Dwg-Reactor nil '((:VLR-beginSave . BeginCloseFunc)))))&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 10 Apr 2023 10:58:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11884805#M32772</guid>
      <dc:creator>doaiena</dc:creator>
      <dc:date>2023-04-10T10:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Make a reactor that once a dynamic block visibility is changed explode and purge block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11884918#M32773</link>
      <description>&lt;P&gt;&lt;FONT face="georgia,palatino" size="4"&gt;Why don't you hire someone to write it for you ?&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 12:03:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/make-a-reactor-that-once-a-dynamic-block-visibility-is-changed/m-p/11884918#M32773</guid>
      <dc:creator>_Tharwat</dc:creator>
      <dc:date>2023-04-10T12:03:00Z</dc:date>
    </item>
  </channel>
</rss>

