Jump to content

Line by direction


Recommended Posts

Posted

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!

Posted

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)


Posted

WOW! Thanks for the response. I will try this on Monday.

Posted

imeb, I made a custom tool button and used your code and it works great!! Thanks so much for your response.

Posted

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:

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...