View Full Version : Set "Read-only" variable "dimstyle" in a reactor?
Mike_R
2007-07-12, 03:23 PM
I'm just wondering here... Is there any way to change the current dimstyle without using the (command) function, to make it usable inside a reactor? With my current LISP knowledge, I can't figure out a way to set a read-only variable on the fly like that. I'm sure there must be a way somehow, which is where this forum comes in... Help me out here guys. ;)
jmcshane
2007-07-12, 04:09 PM
I'm just wondering here... Is there any way to change the current dimstyle without using the (command) function, to make it usable inside a reactor?
You could try using the VL-CMDF function.(I think)
(vl-load-com)
(vl-cmdf "-dimstyle" "Restore" "your dimstyle here")
You would have to take measures to make sure that the dimstyle exists first.
Mike_R
2007-07-12, 05:20 PM
You could try using the VL-CMDF function.(I think)
That definitely sounds better than using (command). At least with this, it notices the error and just doesn't send the call.
The only problem is this: I want to know for sure that it's going to set my dimstyle whenever necessary and not have to check for it. So, if using this inside a reactor would cause an error (since it's still basically a (command) call), then it would skip it and my dimstyle would not be set, and I would have to do so manually.
Doesn't sound like much, I know, but what I'm trying to do is to make it so all that needs to be done to setup everything in each drawing is use the proper template and press 1 single button and never have to worry about anything being set properly in that drawing... And this "read-only" dimstyle variable is the only thing in the way.
Regards,
Mike
jmcshane
2007-07-12, 06:14 PM
Doesn't sound like much, I know, but what I'm trying to do is to make it so all that needs to be done to setup everything in each drawing is use the proper template and press 1 single button and never have to worry about anything being set properly in that drawing... And this "read-only" dimstyle variable is the only thing in the way.
Surely by having all your dimstyles etc. set up in a template, you shouldn't have to worry about your dimstyle being present in the drawing.
Why not set up an Acaddoc.lsp with all your settings ?
That way whenever you start a drawing all your settings are properly.
Since doing just that, I no longer have to leave my desk whenever somebody
rings saying that somethings wrong, or something doesn't work. I just tell them to
reopen their drawing and everything sets itself back to the way it was.
Getting back to the reactor question, Check this out.
[http://forums.augi.com/showthread.php?t=16702]
Regards
John
Mike_R
2007-07-12, 07:18 PM
Surely by having all your dimstyles etc. set up in a template, you shouldn't have to worry about your dimstyle being present in the drawing.
Yes, the dimstyle is always present in the drawing. The only problem is, we use different styles for different things, and sometimes it doesn't get set back to how it should be. Especially considering the fact that before I got here, there was a hodgepodge of Lisp routines written by different programmers, some from the internet and some from different firms... Needless to say, they don't always work well together. I'm working on that but in the meantime I need reactors, etc. to make sure everything is as close to how I want it as possible.
Why not set up an Acaddoc.lsp with all your settings ?
That way whenever you start a drawing all your settings are properly.
You should see the acaddoc.lsp we have here... While I have cleaned it up quite a bit, it's still ugly.
Getting back to the reactor question, Check this out.
[http://forums.augi.com/showthread.php?t=16702]
That's pretty much exactly what I was looking for! Now I just have to find the best way to make it work. Thank you!
Regards,
Mike
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.