<?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: How to pass arguments to reactor defun? in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13003923#M9569</link>
    <description>&lt;P&gt;This may be a helpful example it has 3 functions that are trapped by a reactor. Load the lisp and type C123 and you will see how it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;; Enter the filet radius as part of a command line entry f100, O234 for offset, c123.45 for circle, P123 for pline width
; original code and methology by Alan H
; assistance and code that worked by Lee-Mac
; OCT 2015
; Edited by Mhupp Sep 2022

((lambda nil
  (vl-load-com)
  (foreach obj (cdar (vlr-reactors :vlr-command-reactor))
    (if (= "fillet-reactor" (vlr-data obj))
      (vlr-remove obj)
    )
  )
  (vlr-command-reactor "fillet-reactor" '((:vlr-unknowncommand . fillet-reactor-callback)))
 )
)

(defun plwid (/ oldwidth)
  (setq oldwidth (getvar 'plinewid))
  (setvar 'plinewid num)
  (vla-sendcommand fillet-reactor-acdoc "_.pline ")
  (setvar 'plinewid oldwidth)
)
(defun filletrad ()
  (setvar 'filletrad num)
  (vla-sendcommand fillet-reactor-acdoc "_.fillet ")
)
(defun makecirc ()
  (setvar 'circlerad num)
  (vla-sendcommand fillet-reactor-acdoc "_.Circle ")
)
(defun offdist ()
  (setvar 'offsetdist num)
  (vla-sendcommand fillet-reactor-acdoc "_.Offset ")
)
(defun fillet-reactor-callback (obj com / num)
  (setq com (car com))
  (cond
    ((and
      (eq (strcase (substr com 1 1)) "F")
      (numberp (setq num (distof (substr com 2))))
      (&amp;lt;= 0.0 num)
     )  ; and
      (filletrad)
    )

    ((and
      (eq (strcase (substr com 1 1)) "C")
      (numberp (setq num (distof (substr com 2))))
      (&amp;lt;= 0.0 num)
     )  ;and
      (makecirc)
    )

    ((and
      (eq (strcase (substr com 1 1)) "O")
      (numberp (setq num (distof (substr com 2))))
      (&amp;lt;= 0.0 num)
     )  ; and
      (offdist)
    )
    ((and
      (eq (strcase (substr com 1 1)) "P")
      (numberp (setq num (distof (substr com 2))))
      (&amp;lt;= 0.0 num)
     )  ; and
      (plwid)
    )
  )     ; master cond
)       ; defun

(or fillet-reactor-acdoc 
    (setq fillet-reactor-acdoc (vla-get-activedocument (vlax-get-acad-object)))
)&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 06 Sep 2024 00:13:09 GMT</pubDate>
    <dc:creator>Sea-Haven</dc:creator>
    <dc:date>2024-09-06T00:13:09Z</dc:date>
    <item>
      <title>How to pass arguments to reactor defun?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/12993670#M9558</link>
      <description>&lt;P&gt;Since I haven't found a way, I use global vars instead: My global var is: &lt;STRONG&gt;#React_globalvar&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(vlr-editor-reactor nil '((:VLR-commandEnded . FuncName)))&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;My reactor defun is:&lt;STRONG&gt;&lt;BR /&gt;(defun FuncName (CALL CALLBACK / cBNam el en ssBlk) (alert #React_globalvar))&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Is there a way to pass arguments to the reactor defun &lt;STRONG&gt;FuncName &lt;/STRONG&gt;?&lt;BR /&gt;&lt;BR /&gt;Would appreciate your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2024 23:42:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/12993670#M9558</guid>
      <dc:creator>NVIT</dc:creator>
      <dc:date>2024-08-31T23:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass arguments to reactor defun?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/12994024#M9559</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/78076"&gt;@NVIT&lt;/a&gt;&amp;nbsp;hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the following is from the AutoLISP reference:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;vlr-command-reactor (AutoLISP/ActiveX)
Constructs an editor reactor that notifies of a command event

Supported Platforms: Windows only

Signature
(vlr-command-reactor data callbacks)
data
Type: Integer, Real, String, List, VLA-object, Safearray, Variant, T, or nil

Any AutoLISP data to be associated with the reactor object; otherwise nil if no data is to be associated with the reactor.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cause the format of the callback is fix,&amp;nbsp; the AutoLISP&amp;nbsp;&lt;SPAN&gt;interpreter must know in advance the arguments that pass, you can not add more arguments but you can pass any data&amp;nbsp; type at the reactor definition call with &lt;FONT color="#0000FF"&gt;&lt;EM&gt;data&lt;/EM&gt; &lt;/FONT&gt;argument&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;and access it (inside callback) with (vlr-data react) even change it with (vlr-data-set react data)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000FF"&gt;&lt;EM&gt;data&lt;/EM&gt;&lt;/FONT&gt;&amp;nbsp;could be a fix value (e.g a string) or any global variable you have.&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;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2024 08:51:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/12994024#M9559</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2024-09-01T08:51:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass arguments to reactor defun?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/12998800#M9560</link>
      <description>The FuncName section shall only be used to "sniff out" the command (or variable, etc.) in question, and if true, send to a separate function.&lt;BR /&gt;&lt;BR /&gt;To do this, structure it as a COND:&lt;BR /&gt;(defun FuncName (CALL CALLBACK / )&lt;BR /&gt;(cond&lt;BR /&gt;((eq (car CALLBACK) "PLOT") (PlotFunction))&lt;BR /&gt;((eq (car CALLBACK) "PUBLISH") (PublishFunction))&lt;BR /&gt;((eq (car CALLBACK) "LAYOUT_CONTROL") (LayoutFunction))&lt;BR /&gt;(T (princ))&lt;BR /&gt;);cond&lt;BR /&gt;);end FuncName&lt;BR /&gt;&lt;BR /&gt;This structure will minimize any pauses/delays that may be encountered if not structured this way.&lt;BR /&gt;</description>
      <pubDate>Tue, 03 Sep 2024 20:11:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/12998800#M9560</guid>
      <dc:creator>scot-65</dc:creator>
      <dc:date>2024-09-03T20:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass arguments to reactor defun?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/12998807#M9561</link>
      <description>Thanks for you help, Moshe. I'll need to study that. Basically, I'd like to pass args to the FuncName</description>
      <pubDate>Tue, 03 Sep 2024 20:15:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/12998807#M9561</guid>
      <dc:creator>NVIT</dc:creator>
      <dc:date>2024-09-03T20:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass arguments to reactor defun?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/12998812#M9562</link>
      <description>Thanks for your help, Scot. Basically, I'd like to pass args to each PlotFunction, PublishFunction, or LayoutFunction. Can that be done?</description>
      <pubDate>Tue, 03 Sep 2024 20:18:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/12998812#M9562</guid>
      <dc:creator>NVIT</dc:creator>
      <dc:date>2024-09-03T20:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass arguments to reactor defun?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13000202#M9563</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/78076"&gt;@NVIT&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/78076"&gt;@NVIT&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thanks for your help, Scot. &lt;FONT color="#0000FF"&gt;Basically, I'd like to pass args to each PlotFunction, PublishFunction, or LayoutFunction&lt;/FONT&gt;. Can that be done?&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Yes you can but it would be global variables&amp;nbsp; [or wrap it all in a big (c:xxx) ] bare in mind if you accept&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/43171"&gt;@scot-65&lt;/a&gt;&amp;nbsp; suggest&amp;nbsp; (which is very good) you'll still be restricted to using reactor callback limitations which is no pause using (getxxxx) functions, no (command)&amp;nbsp; calls...&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;</description>
      <pubDate>Wed, 04 Sep 2024 12:35:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13000202#M9563</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2024-09-04T12:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass arguments to reactor defun?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13001393#M9564</link>
      <description>Per my original post, I am already using global variables, but would like to prevent from doing that by passing it to the reactor function instead.&lt;BR /&gt;&lt;BR /&gt;Per your response, there seems to be no way to do what I originally asked.&lt;BR /&gt;&lt;BR /&gt;Thank you for your help.</description>
      <pubDate>Wed, 04 Sep 2024 21:45:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13001393#M9564</guid>
      <dc:creator>NVIT</dc:creator>
      <dc:date>2024-09-04T21:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass arguments to reactor defun?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13001551#M9565</link>
      <description>&lt;P&gt;I'm not sure if this is what you are looking for exactly, but in the set up of the reactor, you can add data to it and/or change it at any point.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I'll give an example with a command reactor.&lt;/P&gt;&lt;P&gt;Quote from autodesk documentation:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;vlr&lt;/SPAN&gt;&lt;SPAN class=""&gt;-&lt;/SPAN&gt;&lt;SPAN class=""&gt;command&lt;/SPAN&gt;&lt;SPAN class=""&gt;-&lt;/SPAN&gt;&lt;SPAN class=""&gt;reactor &lt;/SPAN&gt;&lt;EM&gt;&lt;SPAN class=""&gt;data callbacks&lt;/SPAN&gt;&lt;/EM&gt;&lt;SPAN class=""&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, you can initialize your reactor with some data attached, or add it at a later point. Just make sure you keep your target reactor in a global variable.&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 ReactorFun (reactor lst)
  (if (and (equal (vlr-current-reaction-name) ':vlr-commandWillStart) (equal (car lst) "MOVE"))
    (alert (vl-princ-to-string (vlr-data reactor)))
  )
  (princ)
)

(if (not *CommandReactor*)
  (setq *CommandReactor* (vlr-command-reactor (list 1 2 3) '((:vlr-commandWillStart . ReactorFun))))
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example I am creating a command reactor with data added to it /a list containging the numbers 1 2 3/. When the "move" command is executed, the contents of that 'data' is printed out in a window.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can retrieve the 'data' contents of a reactor using the '(vlr-data reactorObject)' function. If you want to change the data contents, the function is '(vlr-data-set reactorObject data)'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know your exact use case for wanting to pass additional data to a reactor function, but I'm pretty sure this will do the job.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 00:21:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13001551#M9565</guid>
      <dc:creator>doaiena</dc:creator>
      <dc:date>2024-09-05T00:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass arguments to reactor defun?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13001570#M9566</link>
      <description>Hi doaiena. Thank you for your detailed help. I'll test it. I was trying to abstract the reactor defun, with the idea of using it in other reactors.</description>
      <pubDate>Thu, 05 Sep 2024 00:32:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13001570#M9566</guid>
      <dc:creator>NVIT</dc:creator>
      <dc:date>2024-09-05T00:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass arguments to reactor defun?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13001967#M9567</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/78076"&gt;@NVIT&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Per my original post, I am already using global variables, but would like to prevent from doing that by passing it to the reactor function instead.&lt;BR /&gt;&lt;BR /&gt;Per your response, there seems to be no way to do what I originally asked.&lt;BR /&gt;&lt;BR /&gt;Thank you for your help.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;No you can not and i think i explained the reason in message #2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the reactor definition must stat global (otherwise it won't be recognized)&lt;/P&gt;&lt;P&gt;the callback definition is fixed (you can add or remove arguments) and it must&lt;/P&gt;&lt;P&gt;stay global (otherwise it won't be recognized)&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;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 06:43:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13001967#M9567</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2024-09-05T06:43:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass arguments to reactor defun?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13002656#M9568</link>
      <description>&lt;P&gt;Perhaps I'm confused but you don't defun a reactor.&amp;nbsp; You defun a reactor callback.&amp;nbsp; For vlr-editor reactors, callback functions should be defined with 2 arguments (the reactor itself that is calling the function and information that relates to the reactor.&amp;nbsp; The best way to learn about what information is passed to callback function monitoring a specific event is to use vlr-trace reactions.&amp;nbsp; For example:&lt;/P&gt;&lt;P&gt;(vlr-editor-reactor nil '((:vlr-commandended . vlr-trace-reaction)))&lt;/P&gt;&lt;P&gt;Using that as context and looking at vlide's trace window after the line command ends, you would see a display like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;; Reaction: :VLR-commandEnded; argument list: (#&amp;lt;VLR-Editor-Reactor&amp;gt; ("LINE"))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get to your specific question each reactor can store any information you want to work with in it DATA argument.&lt;/P&gt;&lt;P&gt;For a callback function to get that data, it should use vlr-data.&amp;nbsp; To store data, it should use VLR-Data-Set&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&amp;nbsp; given the above and using a callback defined as&lt;/P&gt;&lt;P&gt;(defun cmdendcback (R L)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;(setq myinfo (vlr-data R)) ;to get information from reactor data.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;(vlr-data-set R L);to save the last command ended list.&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only global I save is the return value from the construction of the reactor.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;(IF (NULL myeditorreactor)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; (SETQ myeditorreactor (VLR-EDITOR-REACTOR '("just starting")&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; '((:VLR-COMMANDENDED .&amp;nbsp; cmdendcback )))))&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 05 Sep 2024 13:36:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13002656#M9568</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2024-09-05T13:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass arguments to reactor defun?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13003923#M9569</link>
      <description>&lt;P&gt;This may be a helpful example it has 3 functions that are trapped by a reactor. Load the lisp and type C123 and you will see how it works.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;; Enter the filet radius as part of a command line entry f100, O234 for offset, c123.45 for circle, P123 for pline width
; original code and methology by Alan H
; assistance and code that worked by Lee-Mac
; OCT 2015
; Edited by Mhupp Sep 2022

((lambda nil
  (vl-load-com)
  (foreach obj (cdar (vlr-reactors :vlr-command-reactor))
    (if (= "fillet-reactor" (vlr-data obj))
      (vlr-remove obj)
    )
  )
  (vlr-command-reactor "fillet-reactor" '((:vlr-unknowncommand . fillet-reactor-callback)))
 )
)

(defun plwid (/ oldwidth)
  (setq oldwidth (getvar 'plinewid))
  (setvar 'plinewid num)
  (vla-sendcommand fillet-reactor-acdoc "_.pline ")
  (setvar 'plinewid oldwidth)
)
(defun filletrad ()
  (setvar 'filletrad num)
  (vla-sendcommand fillet-reactor-acdoc "_.fillet ")
)
(defun makecirc ()
  (setvar 'circlerad num)
  (vla-sendcommand fillet-reactor-acdoc "_.Circle ")
)
(defun offdist ()
  (setvar 'offsetdist num)
  (vla-sendcommand fillet-reactor-acdoc "_.Offset ")
)
(defun fillet-reactor-callback (obj com / num)
  (setq com (car com))
  (cond
    ((and
      (eq (strcase (substr com 1 1)) "F")
      (numberp (setq num (distof (substr com 2))))
      (&amp;lt;= 0.0 num)
     )  ; and
      (filletrad)
    )

    ((and
      (eq (strcase (substr com 1 1)) "C")
      (numberp (setq num (distof (substr com 2))))
      (&amp;lt;= 0.0 num)
     )  ;and
      (makecirc)
    )

    ((and
      (eq (strcase (substr com 1 1)) "O")
      (numberp (setq num (distof (substr com 2))))
      (&amp;lt;= 0.0 num)
     )  ; and
      (offdist)
    )
    ((and
      (eq (strcase (substr com 1 1)) "P")
      (numberp (setq num (distof (substr com 2))))
      (&amp;lt;= 0.0 num)
     )  ; and
      (plwid)
    )
  )     ; master cond
)       ; defun

(or fillet-reactor-acdoc 
    (setq fillet-reactor-acdoc (vla-get-activedocument (vlax-get-acad-object)))
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 06 Sep 2024 00:13:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/how-to-pass-arguments-to-reactor-defun/m-p/13003923#M9569</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2024-09-06T00:13:09Z</dc:date>
    </item>
  </channel>
</rss>

