Skip to content

Looking for a method to set SnapMode #7457

Answered by bbastings
saaaaaally asked this question in Q&A
Discussion options

You must be logged in to vote

IModelApp.accuSnap.enableSnap(false)

That's not sufficient obviously, as I mentioned you need to get the point from the depth buffer instead. You are not going to be able to set the snap mode because that's not it's intended purpose.

Imagine a user that has set their snap mode(s) to keypoint, then they run your tool and not noticing or expecting their snap mode to be changed try placing a line. Now they may make an error because they don't get the exact endpoint they'd expect from keypoint snap.

The above situation "could" be addressed by your tool saving the current snap mode(s) in onPostInstall and restoring the snap mode(s) in onCleanup...but that's still problematic as the user can …

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@bbastings
Comment options

@MarcBedard8
Comment options

@saaaaaally
Comment options

saaaaaally Dec 10, 2024
Collaborator Author

Comment options

You must be logged in to vote
0 replies
Answer selected by saaaaaally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants