+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Senior Member ketxu's Avatar
    Computer Details
    ketxu's Computer Details
    Operating System:
    Sorry, my English not well :(
    Computer:
    Sorry, my English not well :(
    Motherboard:
    Sorry, my English not well :(
    CPU:
    Sorry, my English not well :(
    RAM:
    Sorry, my English not well :(
    Graphics:
    Sorry, my English not well :(
    Primary Storage:
    Sorry, my English not well :(
    Secondary Storage:
    Sorry, my English not well :(
    Monitor:
    Sorry, my English not well :(
    Using
    AutoCAD 2007
    Join Date
    Sep 2010
    Location
    Sorry, my English not well :(
    Posts
    169

    Question [Help] How can i decide which Vlr do in runtime ?

    Registered forum members do not see this ad.

    Hi All
    Please help me a problem.
    I have some reactor function in one file.
    The first time load lisp, i will decided which reactor to used follow a variable (call x) like :
    Code:
    (cond
        ((= x 1)(setq Reactor-Put1 (vlr-editor-reactor nil '((:vlr-commandended . Function1)))))
        ((= x 2)(setq Reactor-Put2 (vlr-editor-reactor nil '((:vlr-commandended . Function2)))))
        ((= x 3)(setq Reactor-Put3 (vlr-editor-reactor nil '((:vlr-commandended . Function3)))))
    )
    But value of x can be changed later when user choice other method (by a dialog). how can i watching x value to decided what to do next ?
    Ex : default value of x is store in registry as 1. So the first time it will call function1 reactor. But then user change it value to 2. How can i run actor function2 and remove vlr funtion1
    Have i make a temple function to call ?

    Thanks all for reading

  2. #2
    Senior Member
    Computer Details
    JohnM's Computer Details
    Operating System:
    xp pro
    Using
    AutoCAD 2006
    Join Date
    Feb 2009
    Location
    houston, texas
    Posts
    380

    Default

    Registered forum members do not see this ad.

    Have a look at the vlr function list there are a few functions to deal with reactors
    Vlr-remove & vlr-reactors.
    When dealing with reactors it’s a good idea to check and see if a reactor is loaded before calling it again.
    If you call it twice there will be 2 instances of the reactor running
    So in your cond statement you can use (if (not reactor-put1 (setq reactor-put1…………..
    So if the user selects another reactor you need to unload the current one using
    (if reactor-put1(vlr-remove reactor-put1))
    From my experience reactors are hard to debug so you only want to load then once and remove them when done unless you want them to be persistent.

Similar Threads

  1. runtime error 94
    By MR MAN in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 1st Jul 2009, 09:15 am
  2. Help decide the future at AUGI
    By CAD Panacea in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 23rd Jan 2009, 05:00 pm
  3. LT 2009 with Subscription or eBay LT 2008 ?? Please help decide.
    By Jez(UK) in forum Software & Licensing
    Replies: 4
    Last Post: 23rd Jan 2009, 01:06 pm
  4. .net Runtime error
    By PhUzZ in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 26th Apr 2006, 01:24 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts