Squirltech Posted October 15, 2010 Posted October 15, 2010 Good morning everyone! I'm just wondering if there is a way to change the line by direction command in ACAD 09 LDC. If you cancel out of the command, using ESC, you lose all of your OSnap settings. If you cancel out of the command with the enter key, your OSnap settings are saved. Is there a variable somewhere that allows you to cancel the command using either way without losing your OSnap settings? Just curious. Thanks! Quote
irneb Posted October 16, 2010 Posted October 16, 2010 Not sure about the command itself, since I don't have LDC. But this type of error happens a lot with custom lisp commands. The problem is if the command needs to change the OSNAPS to work correctly it needs to change the OSMODE sysvar temporarily, saving the setting to restore later. But when the user presses Esc, the entire lisp is stopped, thus the restore doesn't happen. This may also be a problem in VBA, ARX and DotNet addons, but I'm not that clued-up about those. The "best" way would be to add error handling to the lisp function. Search the AutoLisp forum for error handling, or check this thread on AUGI: http://forums.augi.com/showthread.php?t=121136 Alternatively, you could create a button to reset your OSMODE to whatever you prefer. So if this happens again, you can simply click that button. To do this: Ensure you've got your OSnaps set correctly. Type OSMODE at the command prompt. Take note of the number indicated there. Add the following Macro as the button's macro, change the 111 to whatever you OSMODE was set to.^C^C^P(setvar "OSMODE" 111) Quote
Squirltech Posted October 16, 2010 Author Posted October 16, 2010 WOW! Thanks for the response. I will try this on Monday. Quote
Squirltech Posted October 18, 2010 Author Posted October 18, 2010 imeb, I made a custom tool button and used your code and it works great!! Thanks so much for your response. Quote
irneb Posted October 19, 2010 Posted October 19, 2010 You're welcome! Glad I could help. It's not the perfect solution though, but at least you can fix the problem with a minimal amount of hassle :wink: Quote
alanjt Posted October 19, 2010 Posted October 19, 2010 That's just how the function was written for LDD and since it's a dead program (as of release 2009), you aren't going to see any updates/fixes. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.