My first reactor

Discussion in 'AutoCAD' started by Jamie Duncan, Apr 10, 2004.

  1. Jamie Duncan

    Jamie Duncan Guest

    Here's the scenario.

    I have many lisps that have all kinds of code for user input for default settings, it is difficult to maintain, and to write new code because of the many global variables. Most of these centre around annotation values/layers etc. I visualise a new global variable which is a list as follows:

    say note_text is a variable, now I read data in from a text file (done for each drawing session)

    so that I have a stream of data like:
    note_text,DIST,7,5/64,2," Text Height For Notes: ","TEXTSIZE"

    which becomes [part of a large list like
    (("note_text_Type" . "DIST")("note_text_height" . 2)("note_text_message" . ," Text Height For Notes: "))) etc

    this means that I basically need only one general input function for all variables, and that each routine as I enter it would set up the list of variables it needs like:
    ("note_text" "note_arrows" "note_layer") etc. which is another global variable say cur_defaults

    Now here's the reactor part.

    I want it so that when a certain key sequence is pressed ctrl + 3 for example, the reactor kicks and allows the user to adjust any of the defaults for the current active routine.

    Is this possible in lisp? will I get a cannot re-enter lisp? do reactors allow for user input?
    should I use gread instead (which is a pain)?!

    I can see an improvement using this method because it is now a simple editable text file to set all my defaults instead of hardcoding them. Also reduces number of global variables to less than 10 compared to the 200+ now.

    Any comments or suggestions?
     
    Jamie Duncan, Apr 10, 2004
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.