Push/pull (or drag) with increment ?

Push/pull (or drag) with increment ?

Postby TBoy » Sun May 07, 2017 2:45 pm

In scripts when we drag with mouse, code looks like:

view.draw_line startPossition, endPossition

'start Position' is defined by click, 'end Position' is moving with mouse.
Is it possible while dragging mouse to snap on every next 0,5cm or 1cm (for example) instead of smooth dragging.
What code can I use to obtain such a behavior?
0

TBoy 
 

Re: Push/pull (or drag) with increment ?

Postby sdmitch » Sun May 07, 2017 4:56 pm

TBoy wrote:In scripts when we drag with mouse, code looks like:

view.draw_line startPossition, endPossition

'start Position' is defined by click, 'end Position' is moving with mouse.
Is it possible while dragging mouse to snap on every next 0,5cm or 1cm (for example) instead of smooth dragging.
What code can I use to obtain such a behavior?


Here is a simple example of how I would do it.
0
Nothing is worthless, it can always be used as a bad example.

http://sdmitch.blogspot.com/
User avatar
sdmitch 
PluginStore Author
PluginStore Author
 

Re: Push/pull (or drag) with increment ?

Postby TBoy » Sun May 07, 2017 8:50 pm

Thank you !
Exactly as I wanted to be.
0

TBoy 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 



 

Return to Developers' Forum

Who is online

Users browsing this forum: No registered users and 3 guests

Visit our sponsors: