So I have an idea I want to kick around, more as a brainstorming of something that I might maybe use someday instead of a problem I'm having right now.
I haven't slapped anything together yet, more looking into options. I've looked into dictionaries, xrecords, and UserIx, UserRx, and UserSx. Unless I'm misunderstanding something somewhere these are all stored and persistent within an individual DWG (stop me if I'm wrong here). All very useful, but need to be individually defined for each drawing. What I'm looking to do instead is set up some variables that persist across multiple dwgs and sessions, unique to individual users.
So I have an idea, but it seems cumbersome unless there aren't better options I haven't found. So my thought is to write some functions (save-user-var and call-user-var). The "save-user-var" function would need two arguments passed to it, "var-name" and "var-val", it would then open an ascii file named <var-name>.txt (where <var-name> is the actual persistent variable name) in a certain specially set aside folder for these ascii files. This would serve both to create new files for new variables, and overwrite any previously existing ones without endangering any global variables used by Autocad. The "call-user-var" function would only need the "var-name" argument, search for the file, if no <var-name>.txt file is found then it returns nil, if one is found it opens that folder and returns the read-line from it. It seems like it could bloat that particular folder if overused (though on the flip side its going to be rare to require a variable that needs to exist longer than a single execution of a function much less across multiple sessions). Of course, too, it would hardly matter if that folder did have hundreds of small ascii files, the entire folder would still be smaller then most of my individual dwgs.
So that's it. Anyone have anything to chime in on? Like I said, this is more to kick around the possibility and not to figure it out for any specific use right now. Off the top of my head I can think of some uses for it to store our seemingly bi-weekly changing client requirements, or say allow for code that can auto-fill certain portions of a title block without having to individualize for each user, only need to do a one-time setup for each user, then it can be accessed by generic code at need.