|
Welcome, Guest.
|
||||||
| AutoLISP AutoLISP or Visual LISP, learn both here! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
AUGI Addict
Join Date: 2001-05
Location: Austin, TX USA
Posts: 2,013
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Hey Guys,
I'm upgrading a routine that I wrote that allow you to assign different Layer, Ltscale, Dimscale, and Text Style to each layout. The routine uses a ini file to store default settings and xrecords to store the info for each layout in the drawing. One of the upgrades is the ability to turn off some of the options so that they don't change when switching layouts. The Problem: When turning off a setting and switching to another layout, the info (for that option) that is stored in the xrecords is overwritten with the settings of the layout switched to. I want it to retain that setting so if I turn the option back on and go back to that layout, it sets it back to what it was before turning off the option. yet?Looks like whats happening: There is a reactor that looks for these variables to change. The reactor fires a routine that will save the setting to the xrecord for the current layout. There is another reactor that fires when changing layouts. It fires a routine that will retrieve the info from the xrecord for the layout being switch to. In this routine, I disable the reactor that watches for changes in the variables. It appears that the reactor is not disabled and fires off the routine and then overwrites the info in the xrecords. I hope this makes since. I will try to clarify if needed. I would appreciate any help. Also if you see something that could be coded better, let me know.
__________________
![]() I explode MTEXT. ![]() Last edited by Glenndp : 2005-02-23 at 03:32 PM. Reason: Removed old non-working code. |
|
|
|
|
|
#2 |
|
Vice President / Director
Join Date: 2000-09
Location: Kenosha Wisconsin
Posts: 375
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Xdata seems to me to be a more direct way of storing data on a layout than an xrecord in a dictionary.
Also I found the sequence of the reactors firing like you discovered after the layout changes. You need to have the "current" layout information recorded before you attempt to switch layouts. What I would do is use a system variable reactor to monitor the different items you wish the layout to remember. Always have the data updated. The current layout information would be constantly updated in an xrecord. The reactor would only update the current layout after you switch. I hope that makes sense. I will play around with some of my code to see if I can cook up an example. Peter Jamtgaard |
|
|
|
|
|
#3 | ||
|
AUGI Addict
Join Date: 2001-05
Location: Austin, TX USA
Posts: 2,013
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Quote:
Quote:
Thanks for the response. I would appreciate any examples you can give me.
__________________
![]() I explode MTEXT. ![]() |
||
|
|
|
|
|
#4 |
|
AUGI Addict
Join Date: 2001-05
Location: Austin, TX USA
Posts: 2,013
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Okey, I think I have it working now. I still couldn't keep the reactor from firing after switching layouts
Still like to know why the I couldn't disable the reactor. This would have made things a lot easier. Here is the new version. I would appreciate it if some of you guys could test and give me feedback Thanks.
__________________
![]() I explode MTEXT. ![]() |
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using commands with reactors | patrick.fitzgerald | AutoLISP | 5 | 2004-06-28 03:07 AM |