CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 18, 2017, 13:37:53 pm


Login with username, password and session length


Pages: [1]
  Print  
Author Topic: More Snaps!  (Read 574 times)
jk
Storm Trooper
***
Offline Offline

Posts: 205


View Profile
« on: August 23, 2017, 03:27:27 am »

Please switch to the alternative plugin by EddyCurrent. It does the same, but no manual intervention
required.

http://www.cambam.co.uk/forum/index.php?topic=6790

----
A quick and hacky plugin to provide a few more snaps to objects, namely
midpoints of lines,
midpoints of arcs,
quadrants of circles

It exploits a public function AddSnapPoint, which adds a custom point to the running snaps list.
Unfortunately, it works only until the next screen redraw (zoom/pan/etc).
Redrawing will regenerate all the snaps and discard custom ones.

So the usage pattern is:
1) prepare for operation involving snapping, do zoom/pan/etc
2) run View->More Snaps! or press Ctrl+Left Win - it will generate more snaps
3) do a happy snapping, avoiding zoom/pan/etc

Hopefully Andy will add more snaps in future versions and this plugin will become useless.

Binary for CB1.0 is attached below.

* moresnaps_1_0_0.zip (3.27 KB - downloaded 34 times.)
« Last Edit: August 28, 2017, 15:02:35 pm by jk » Logged
Garyhlucas
CNC Jedi
*****
Offline Offline

Posts: 1016


View Profile
« Reply #1 on: August 24, 2017, 02:21:25 am »

I need to try this. These were on my wish list to Andy a couple years ago now.  In my other CAD programs I use those three all the time.  Thanks for your work on this,
Logged

Gary H. Lucas

Have you read my blog?
 http://a-little-business.blogspot.com/
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4745



View Profile WWW
« Reply #2 on: August 24, 2017, 04:01:21 am »

Hello

Nice idea !

For me the short cut is not working, maybe a wrong setting on my keyboard (the Win key as no effect anywhere)

Quote
Unfortunately, it works only until the next screen redraw (zoom/pan/etc).

Maybe an event of the main windows (activeview CamBam.ThisApplication.TopWindow) can inform if the main form/display has been refreshed ?

++
David

« Last Edit: August 24, 2017, 04:11:16 am by dh42 » Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4745



View Profile WWW
« Reply #3 on: August 24, 2017, 05:16:20 am »

I continue to play with the plugin ; the pan/zoom etc are not the only things that clear the snap list ; it is also the case when you enter in an edit mode, like when you double click on a polyline to move a node. In this case, first enter in edit mode by double click on a polyline (or also on circles, arcs, lines and splines in the V1) then activate the More snap to be able to use it in edit mode.

I think it's a very useful addition, thanks for that !

++
David
Logged
tau
Storm Trooper
***
Offline Offline

Posts: 113



View Profile
« Reply #4 on: August 24, 2017, 08:15:27 am »

Thanks, jk!

Unfortunately i couldn't get this thing started?! I don't have a clue what i'm missing....


@David
I'm pretty sure one of your excellent short videos could shed some light on 'How-to use this thing..'  Grin

Thank you & regards,

Tunc
Logged
jk
Storm Trooper
***
Offline Offline

Posts: 205


View Profile
« Reply #5 on: August 24, 2017, 08:43:05 am »

In other words, one should execute More Snaps just before the snapping )

The screen refresh event may be used, but it will complicate things.
CB fires a separate background thread which collects the snaps. It will update the snap list upon finish.
While it working, the snap list is locked and AddSnapPoint produce nothing. This thread is internal to CB,
and we have no way to know if it completed.

So I see a two ways:
1) wait a little after the refresh event to allow the snapping thread to finish, then collect and add our
custom snaps.
2) fire More Snaps manually. In most cases the the natural human delay allow snapping thread to finish.
In case it is not (snaps seems do not working), just execute More Snaps again. Stupid computer !

Anybody has same Ctrl+Left Win shortcut problem as dh42 ? On my PC it is woking fine and combination
is pretty convenient.
« Last Edit: August 24, 2017, 09:01:03 am by jk » Logged
lloydsp
CNC Jedi
*****
Online Online

Posts: 7151



View Profile
« Reply #6 on: August 24, 2017, 11:55:52 am »

"CB fires a separate background thread which collects the snaps. It will update the snap list upon finish.
While it working, the snap list is locked and AddSnapPoint produce nothing. This thread is internal to CB,
and we have no way to know if it completed. "

---------

That doesn't sound right to me.  I could swear I've seen at least one plugin that had deliberate (and synchronized) waits for background processes it couldn't directly monitor.

I'll have to look through my archives.

Lloyd

Logged

"Pyro for Fun and Profit for More Than Fifty Years"
dave benson
CNC Jedi
*****
Offline Offline

Posts: 793


View Profile
« Reply #7 on: August 24, 2017, 13:02:03 pm »

IT's been used in a couple of scripts and plugins.
http://www.cambam.co.uk/forum/index.php?topic=4076.0
Code:
while view.CurrentEditMode is not None:
app.Sleep(1)
I had the same thought as David, in C# you can subscribe to an event with a Delegate.

Dave
Logged
Bob La Londe
CNC Jedi
*****
Offline Offline

Posts: 2989


^ 8.5 pounds on my own hand poured bait.


View Profile WWW
« Reply #8 on: August 24, 2017, 16:00:54 pm »

This is a very useful plugin.  I will try to make some time to install and test it today. 
Logged

Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3217



View Profile
« Reply #9 on: August 25, 2017, 21:52:18 pm »

Thanks JK for finding AddSnapPoint, it was the missing part for a plugin I've been playing with for a while.  Wink

Here; http://www.cambam.co.uk/forum/index.php?topic=6790.msg55226#msg55226
« Last Edit: August 25, 2017, 22:18:00 pm by EddyCurrent » Logged
jk
Storm Trooper
***
Offline Offline

Posts: 205


View Profile
« Reply #10 on: August 28, 2017, 15:03:22 pm »

Ok, your plugin is better than mine )

First post updated with the link to it.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.234 seconds with 18 queries.

Copyright © 2008 HexRay Ltd. | Sitemap