Seath 发表于 2022-7-6 17:15:16

Restore Osnap's

I use an addon called Hydratec with AutoCAD 2007.One of our commands presets the Osnaps.I want to make a button so after I finish with the Hydratec command I can restore my Osnap settings.I want to be able to use it in the middle of a command with out breaking the command if possable.Thanks for any help!

Guest LElkins 发表于 2022-7-6 17:20:37

Off the top of my head, I can think it may be possible, but you would either (a) have to click a button before using the tool to 'mark' the snap settings, or (b) use a standard list of snaps, then activate any additional afterwards.
would this be ok?

lpseifert 发表于 2022-7-6 17:23:04

use this macro for a new command and make a toolbar button from it.

(setvar "osmode" 1)
the integer after "osmode" is the sum of the bitcodes for the snaps you want on. The above will turn endpoint on. See Help for the system variable Osmode for a listing of the bitcodes.

Seath 发表于 2022-7-6 17:27:27

 
That worked for creating a new button thanks! Is there a way to make the button not break my current command? ie. I am in the middle of a move command and need to reset my Osnaps I click the button and my command doesnt break. Currently while in a command it does break the command.
 
Thanks for all the help so far!

Guest LElkins 发表于 2022-7-6 17:28:45

If you are in the middle of a command, then just hold Shift + RightClick to select a temporary snap point. Then reset the snaps after.
 
cheers

lpseifert 发表于 2022-7-6 17:32:28

If you have ^C^C in your macro remove them.

Seath 发表于 2022-7-6 17:35:38

 
I removed the ^C^Cit is still breaking my command.I have tryed putting a ' infront of the command but all that seems to do is mess up the command all together.Any other suggestions?

lpseifert 发表于 2022-7-6 17:40:33

Works for me, are you trying it in the the middle of an Autocad command or Hydratec command?

Seath 发表于 2022-7-6 17:41:05

that is how I have entered it. it uses the 4159 as a distance to move the object i have selected.

CarlB 发表于 2022-7-6 17:46:47

try
 
(setvar "osmode" 4159)(princ)
页: [1] 2
查看完整版本: Restore Osnap's