No one topic seems to cause more consternation than Object Snaps. Here is the what and why of why we do what we do:
We need to have object snaps set for a certain number of commands to ensure that the drawing is connected properly. Many users feel that we willy-nilly overwrite their osnaps, i.e. - don't put them back the way we found them. This is not true. The following rules should explain how you can keep your osnaps:
1. ALL HydraCAD commands are intended to return your default osnaps to you after you complete the command. The only exceptions are the Line and Main commands because these two commands are 'endless' commands (we don't know when they are done). If you find any exceptions, please let us know and we will lock them down.
1A. Right now, the Rapid Pipe commands will not reset your osnaps if you use the Escape key to exit these commands instead of using Enter to exit them. We are working to change this behavior.
2. You can turn off the HydraCAD object snaps and use your own for most of the important commands by picking the Options submenu from the HydraTools pulldown menu. then, pick Use Your Own Object Snaps
3. The Sprinkler, Piping and Hanger toolbars contain their own osnap buttons to be used for the commands found in those toolbars. These effectively give you a second set of osnaps, preserving your basic AutoCAD osnap for when those commands are done. These only need to be set once per drawing.
4. We have been steadily reducing the number of default osnap settings for non-critical commands. These will be entirely up to you to set.
5. We have added two buttons to help make using your default osnaps easier. On the HydraCAD Utilities toolbar there are two commands: Save Osnap (OSS) and Restore Osnap (OSR). These allow you to set a default osnap and bring it back whenever you want.
I realize this is a sensitive topic for some of you but we do need to set some sort of base osnaps so that users (new ones, especially) can 'just draw' and have a reasonable chance of getting a calc or list out without all kinds of drawing errors. Believe me, we've tried it the other way and it hasn't worked.
I've had trouble with my osnaps getting overridden since I started using HydraCAD 6 years ago. At first I would go into the Drawing Settings (DS) and reselect the osnaps I use every time. I eventually learned of a command to set osnaps without having to open the Drawing Settings dialog. It is called OSMODE. The command is entered followed by a number that determines which osnaps are selected. The individual indentifier for each osnap is available in the help file. The number for each desired osnap is added and the sum is entered after OSMODE. To further this solution, I made a shortcut key with the macro "OSMODE ##". For my own purposes, I use endpoint, midpoint, insertion, center, and node, which is OSMODE 47. I've mapped it to the shortcut key combination CTRL+R. So now, whenever I find that my osnaps have been turned off, or changed, I type CTRL+R and they all come right back. I've actually made the macro "^POSMODE 47" so that way it cancels out of any active command and then resets my osnaps. I've found this to be incredibly helpful.
Posted by: James Litvak | November 26, 2010 at 12:47 AM
I have created a very similar routine using OSMODE, for my purposes, I mapped osnaps to the number keypad using transparent modifiers. Using this method I'm able to change or cancel osnaps on the fly without canceling my durrent command.
Posted by: Fprandy | November 30, 2010 at 01:13 PM
Would you mind explaining how to use a transparent modifier? I used to have a lsp file that would make '' (apostrophe apostrophe) be my mid-command command for "mid between two points" but for some reason it doesn't work anymore on AutoCAD 2011.
Posted by: James Litvak | December 02, 2010 at 04:29 PM
I created this a while back with an earlier version of Autocad, with the use of the .mns file, which are no longer in use, but can ?? be brought into newer versions of Autocad.
I did a search on my computer and found the .mns file that contained text for these commands.
***ACCELERATORS
["NUMPAD5"]'_osmode;4;
["NUMPAD1"]'_osmode;1;
["NUMPAD0"]'_osmode;0;
["NUMPAD2"]'_osmode;2048;
["NUMPAD7"]'_osmode;32;
["NUMPAD4"]'_osmode;2;
["NUMPAD3"]'_osmode;512;
["NUMPAD6"]'_osmode;16;
["NUMPAD8"]'_osmode;65;
["NUMPAD9"]'_osmode;128;
I hope this information in some way helps you. I'm not knowledgeable in programming or .lisp and it's entirely possible this will not work in 2011.
Posted by: Fprandy | December 09, 2010 at 06:15 PM
Randy - Yes that will work. You can also bring it in as a partial CUI and transfer the keyboard shortcut to our full menu!
Posted by: Art | December 14, 2010 at 11:28 AM
I have used AutoCad fo a loong time and I don't really find HydraCad snaps useful for me.
I use Razer Naga Mouse and made a macro turning on the snaps I need in order to deal with this little annoyance:
OSMODE [spacebar] 163 [enter] It helps me dimension the drawing to get it ready for the foreman.
163 is the sum for the following snaps: Endpoint, Midpoint, Intersection and Perpendicular.
Link below shows the numerical value corresponding to the osnaps.
http://docs.autodesk.com/ACD/2010/ENU/AutoCAD%202010%20User%20Documentation/index.html?url=WS1a9193826455f5ffa23ce210c4a30acaf-4f1d.htm,topicNumber=d0e352473
Posted by: MAXIMUS Bradley | July 15, 2015 at 04:37 PM
Interestingly, I came to this blog post today and saw my comments above (James Litvak, I just can't access that account now). I've been using the Ctrl+R keyboard shortcut to reset my Osnaps for years. However, having recently switched back to HydraCAD after years of using SprinkCAD, and also having learned LISP programming, and wrote dozens of my own programs, I've noticed that HydraCAD has a huge deficiency with error handling. For example, today I was looking through Sprnks.lsp and noticed that one function (can't remember which, but I believe it was INS_HEAD) calls (c:sos) which saves the current osmode, (os0) which sets osmode to 0, and (c:ROS) which returns the saved osmode. However, if an error occurs between a call of (os0) and (c:ROS), then osmode stays at 0. There should be an error handler that also calls (c:ROS) for such a case. In fact, every function that is only supposed to temporarily change a variable should have an error handler to return the variable if the final return call isn't received. I added my own error handler to the function in question by adding a local variable *error* and simply adding the following right after the function definition:
(defun *error* (errmsg)
(c:ROS)
)
Now it restores my osmode always. I'll be looking through the other lsp files tomorrow to see where I can add error handlers. Osnaps always being changed was one of my biggest pet peeves years ago when I previously used HydraCAD, and it is something that really should have been solved by now. I ask that you please look through your code and add error handlers. I can help if you would like.
Posted by: Iamjamieq | March 19, 2019 at 09:59 PM
Looks like I got my login back.
Anyway, I also noticed that the INS_HEAD function also fails to turn off ORTHOMODE if it was off prior to the command. You need to add in a symbol to save orthomode status, and another to save polar mode status, for example (setq opolar (boole 1 8 (getvar 'AUTOSNAP))). Then reset both at the end of the function and also include an error handler.
You can reset polar mode like this:
(if (= opolar 0)(setvar 'AUTOSNAP (boole 4 8 (getvar 'AUTOSNAP)))(setvar 'AUTOSNAP (boole 7 8 (getvar 'AUTOSNAP))))
It is very frustrating that HydraCAD keeps dictating my object snaps and other/polar status.
Posted by: James Litvak | March 20, 2019 at 09:35 AM
James - You can turn off our control of osnaps completely. That option is specified in this blog post.
Posted by: Art | April 30, 2019 at 02:10 PM
This has been completed for the next update (V56.04, V55.05)
All these items, including OSMODE, ORTHOMODE, EXPERT, AUTOSNAP and PICKBOX, will be restored to previous settings if a command encounters an error. If any slip through the cracks, please let me know.
Posted by: Arthur Dove | May 03, 2019 at 04:06 PM