tombu Posted March 13, 2015 Share Posted March 13, 2015 Cheers for all the advice.I think I'll use osmode in my macro for now. I have a few more questions. 1. Is there a way to switch between osnap and gridsnap while a command is active (move for example) 2. If I load the lisp routine into autocad using appload is it there forever or do I have to load it on each start? Thanks again for the help. This Macro will do it: 'setvar;gridmode;$M=$(if,$(and,16384,$(getvar,osmode)),0,1);^F DIESEL works best for macros. Using lisp in a macro can cause issues if you use them while another lisp is running. Quote Link to comment Share on other sites More sharing options...
Mirkin Posted March 13, 2015 Author Share Posted March 13, 2015 Thanks for the reply I tried what you posted but it doesn't seem to work quite how I would like. It turns object snap on and off but doesn't toggle grid snap, it just turns the grid on and off. Maybe I need two commands, one to go one way and one to go the other. Quote Link to comment Share on other sites More sharing options...
tombu Posted March 13, 2015 Share Posted March 13, 2015 Thanks for the replyI tried what you posted but it doesn't seem to work quite how I would like. It turns object snap on and off but doesn't toggle grid snap, it just turns the grid on and off. Maybe I need two commands, one to go one way and one to go the other. A space appears to be in osmode in the macro I posted, you need to remove it. Sorry, I'm not as familiar with posting code on this site. The DIESEL part sets gridmode the same as osmode, then the ^F toggles osmode so when osnaps are on gridmode is off and when osnaps are off gridmode is on. Quote Link to comment Share on other sites More sharing options...
Mirkin Posted March 13, 2015 Author Share Posted March 13, 2015 Hi Again Yes I noticed the space and removed it. As I said it turns grid mode on but doesn't actually turn grid snap on. It's still a lot better than what I have but the final step would be great if you could manage it, because I'm clueless Quote Link to comment Share on other sites More sharing options...
tombu Posted March 13, 2015 Share Posted March 13, 2015 Hi AgainYes I noticed the space and removed it. As I said it turns grid mode on but doesn't actually turn grid snap on. It's still a lot better than what I have but the final step would be great if you could manage it, because I'm clueless It only toggles gridmode off/on. You have to already have grid display options set in the drawing. Using ddrmodes I checked 2D model space under Grid style. I've never used grid, but this turns the display off/on. Was it the Snap you wanted on/off? Quote Link to comment Share on other sites More sharing options...
Mirkin Posted March 13, 2015 Author Share Posted March 13, 2015 Hi Tombu I never usually use grid mode myself but we have a very old fashioned guy at our place and unfortunately he insists on a lot of the drawings being on a grid. I have no idea why. This is why I need this command. I want to be able to quickly move things onto the grid when I forget to turn it on lol. So ideally one click of the button will turn all OSnaps ON then turn gridmode + gridsnap OFF. Clicking again would turn Osnaps OFF and then gridmode + gridsnap on. If it's a real pain don't worry about it. Quote Link to comment Share on other sites More sharing options...
tombu Posted March 13, 2015 Share Posted March 13, 2015 Try this: 'setvar;gridmode;$M=$(if,$(and,16384,$(getvar,osmode)),0,1);'setvar;snapmode;$M=$(if,$(and,16384,$(getvar,osmode)),0,1);^F Gotta take that space out again… Quote Link to comment Share on other sites More sharing options...
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.