osnap settings not reinstated after program

osnap settings not reinstated after program

Anonymous
Not applicable
891 Views
5 Replies
Message 1 of 6

osnap settings not reinstated after program

Anonymous
Not applicable

I thought I had my osnap settings set correctly so that they turn off during the function (saving what they were originally) and then turned them back on at the end of the defun, but after i run the function the osnap are completely off any ideas?

 

0 Likes
Accepted solutions (1)
892 Views
5 Replies
Replies (5)
Message 2 of 6

rkmcswain
Mentor
Mentor
It's working here for me.

Is the function ending with an error for you?
R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 3 of 6

Anonymous
Not applicable

no the function works perfectly, but when it finishes the osnap are completely blank as if they were still set to 0

0 Likes
Message 4 of 6

rkmcswain
Mentor
Mentor
Wait, what do you mean "as IF they were still set to 0"

What is OSMODE before running it?
What is OSMODE after running it?

For me, both are the same, whether it's 512, or 2048, or whatever.

R.K. McSwain     | CADpanacea | on twitter
Message 5 of 6

Anonymous
Not applicable
Accepted solution

XD I'm a complete idiot the osnap was set to 0 beforehand for some reason XD

0 Likes
Message 6 of 6

SeeMSixty7
Advisor
Advisor

Something else to consider. Your routine does not need to utilize OSNAP settings at all. All your points are absolute points that are calculated. Granted, when running a routine if OSNAPS are set to something and the user picks in a congested area, it may very well snap to a point when running the line command or something like that. You can consider looking at the OSNAPCOORD variable to remedy that.

 

Also when setting the osmode variable and resetting it. It is best to reset it for the very brief instant you want it off and then back on again. Running through your entire command and then resetting opens you up to user canceling or the routine bombing out due to user error or input being incorrect. If you set and reset at the exact time you need it you avoid  the likelihood of it not getting reset. You can also use error trapping, but users are prone to tap the escape key multiple times to get out of something and will typically cancel your error trapping routines efforts to rest the environment as it was.

 

Also another benefit of using entmake methods to create your line work, means it does not interact with user input methods at all, and completely ignores the OSNAP settings.

 

Good luck,

 

 

0 Likes