Civil 3D 2018. Looking for any input on the title of post. My snaps reset every time I use certain line commands (line by bearing). I've seen this is a common problem with no apparent fixes. I'm not extremely familiar with Lisp writing/coding. I know how to load then using the appload command and what not. I'm just looking for a way to either create a button/icon, or create a keyboard command, in civil that I can quickly click just to activate endpoint and node. Use those the most. I've been messing with the CUI interface to no prevail. Any help is greatly appreciated, almost always find the help I am looking for on these forums. Thanks.
Solved! Go to Solution.
Solved by hippe013. Go to Solution.
Some commands disable the running snaps and pretty much force the user to specify a snap for the point that is being prompted. This, for most part, is by design. More information on snaps can be found here:
AutoCAD 2022 Help | About Using Object Snaps | Autodesk
Setting your snaps via Lisp is very easy. You just need to set the OSMODE system variable. Here is an example code that sets the snaps to End, Middle, and Node. Which is 1 (end) + 2 (midpoint) + 8 (Node) = 11.
(defun c:MYSnapMode ()
(setvar "OSMODE" 11)
(princ "\nSnap mode has been set to End, Mid, & Node.")
(princ)
)
More information on OSMODE can be found here:
AutoCAD 2022 Help | OSMODE (System Variable) | Autodesk
How do I go about making a shortcut for that LISP once I have it loaded? I'm a surveyor and use bearing line command quite often. I'm looking for a fast way to just hit a key for a command or create a button to just turn my osmode back on.
How are you invoking the line by Bearing Distance command? Are you clicking a button? or starting the line command and then entering 'BD (transparent command)?
In the version that I am using (Civil 3D 2024) the snaps are not affected when starting the line by bearing command.
Either way, you can use the example code transparently. Type apostrophe and then the command name.
For example: 'MySnapMode
That will set the snaps while the command is running.
I click the line button/icon and hit bearing distance for my line usually. That lisp worked and is making the osnaps stay on for now.. Is there a way to make a button for my toolbar that I could click to turn it on also? Thanks by the way. Just saves a little bit of time. Maybe they fixed it turning the snaps off in 2024.. I know it's been an issue for sometime now.
@jhfoat wrote:Is there a way to make a button for my toolbar that I could click to turn it on also?
Yeah. You can use the CUI command to add and customize toolbars.
My preference is to type commands in rather than using buttons, so I am not the best source for information regarding adding new buttons or toolbars.
Play with it and see how it works.
Can't find what you're looking for? Ask the community or share your knowledge.