Setting Snapping Grid

G

Guenther Sohler

Guest
I was just wondering,
how I would have to code a bindkey for layout
to change the snapping grid.

just found out about the form and the envSetVal,

But i want to get a script for that. How can I access the actual snapping
grid by skill ?
 
Hi,

I think the following will do what you probably want ....
IIRC it's probably from Sourcelink - not shure about it -
but it's trivial in essence.

Regards,
Martin

not speaking for ISIT

------start--------
procedure(setSnapSpacing(value)
let( (winID)
winID = hiGetCurrentWindow()
winID~>xSnapSpacing = value
winID~>ySnapSpacing = value
); let
); procedure

procedure(getSnapSpacing()
let( (winID)
winID = hiGetCurrentWindow()
printf("SnapSpacing (x/y)=(%f/%f)\n" winID->xSnapSpacing
winID->ySnapSpacing)
); let
); procedure

hiSetBindKey("Layout" "<Key>g" "getSnapSpacing()")
hiSetBindKey("Layout" "<Key>1" "setSnapSpacing(0.001)")
hiSetBindKey("Layout" "<Key>2" "setSnapSpacing(0.01)")
hiSetBindKey("Layout" "<Key>3" "setSnapSpacing(0.05)")
hiSetBindKey("Layout" "<Key>4" "setSnapSpacing(0.1)")
hiSetBindKey("Layout" "<Key>5" "setSnapSpacing(0.2)")
hiSetBindKey("Layout" "<Key>6" "setSnapSpacing(0.25)")
hiSetBindKey("Layout" "<Key>7" "setSnapSpacing(0.5)")
hiSetBindKey("Layout" "<Key>8" "setSnapSpacing(1.0)")
hiSetBindKey("Layout" "<Key>9" "setSnapSpacing(5.0)")
hiSetBindKey("Layout" "<Key>0" "setSnapSpacing(10.0)")
hiSetBindKey("Schematics" "<Key>1" "setSnapSpacing(0.015625)")
hiSetBindKey("Schematics" "<Key>2" "setSnapSpacing(0.03125)")
hiSetBindKey("Schematics" "<Key>3" "setSnapSpacing(0.0625)")
hiSetBindKey("Symbol" "<Key>1" "setSnapSpacing(0.015625)")
hiSetBindKey("Symbol" "<Key>2" "setSnapSpacing(0.03125)")
hiSetBindKey("Symbol" "<Key>3" "setSnapSpacing(0.0625)")

---------end-----------

Guenther Sohler wrote:
I was just wondering,
how I would have to code a bindkey for layout
to change the snapping grid.

just found out about the form and the envSetVal,

But i want to get a script for that. How can I access the actual snapping
grid by skill ?
 
wow, that is straight forward :)


On Fri, 15 Dec 2006 14:33:37 +0100, Martin Heller wrote:

Hi,

I think the following will do what you probably want ....
IIRC it's probably from Sourcelink - not shure about it -
but it's trivial in essence.

Regards,
Martin

not speaking for ISIT

------start--------
procedure(setSnapSpacing(value)
let( (winID)
winID = hiGetCurrentWindow()
winID~>xSnapSpacing = value
winID~>ySnapSpacing = value
); let
); procedure

procedure(getSnapSpacing()
let( (winID)
winID = hiGetCurrentWindow()
printf("SnapSpacing (x/y)=(%f/%f)\n" winID->xSnapSpacing
winID->ySnapSpacing)
); let
); procedure

hiSetBindKey("Layout" "<Key>g" "getSnapSpacing()")
hiSetBindKey("Layout" "<Key>1" "setSnapSpacing(0.001)")
hiSetBindKey("Layout" "<Key>2" "setSnapSpacing(0.01)")
hiSetBindKey("Layout" "<Key>3" "setSnapSpacing(0.05)")
hiSetBindKey("Layout" "<Key>4" "setSnapSpacing(0.1)")
hiSetBindKey("Layout" "<Key>5" "setSnapSpacing(0.2)")
hiSetBindKey("Layout" "<Key>6" "setSnapSpacing(0.25)")
hiSetBindKey("Layout" "<Key>7" "setSnapSpacing(0.5)")
hiSetBindKey("Layout" "<Key>8" "setSnapSpacing(1.0)")
hiSetBindKey("Layout" "<Key>9" "setSnapSpacing(5.0)")
hiSetBindKey("Layout" "<Key>0" "setSnapSpacing(10.0)")
hiSetBindKey("Schematics" "<Key>1" "setSnapSpacing(0.015625)")
hiSetBindKey("Schematics" "<Key>2" "setSnapSpacing(0.03125)")
hiSetBindKey("Schematics" "<Key>3" "setSnapSpacing(0.0625)")
hiSetBindKey("Symbol" "<Key>1" "setSnapSpacing(0.015625)")
hiSetBindKey("Symbol" "<Key>2" "setSnapSpacing(0.03125)")
hiSetBindKey("Symbol" "<Key>3" "setSnapSpacing(0.0625)")

---------end-----------

Guenther Sohler wrote:
I was just wondering,
how I would have to code a bindkey for layout
to change the snapping grid.

just found out about the form and the envSetVal,

But i want to get a script for that. How can I access the actual snapping
grid by skill ?
 

Welcome to EDABoard.com

Sponsor

Back
Top