View Single Post
Old 12-02-2016, 09:54 AM   #241
Human being with feelings
Join Date: Sep 2008
Location: UK
Posts: 359

Originally Posted by spk77 View Post
Grid/Snap settings seems to be stored into rpp files?

My request is - Easier access to the "Grid/Snap settings":
  • get checkbox states (from the "Grid/Snap settings" dialog)
  • get values from the edit boxes and dropdown lists

Thank you.

I'm also interested in this but would like to be able to set values as well.

I'm wondering if a feasible more general approach would be something like set_config_var -- is there any way to do that at the moment? (I'm guessing not.)

e.g. I'm currently doing something involving:

int *projshowgrid = (int *)get_config_var("projshowgrid", &sz0);

int *maxsnaptrack = (int *)get_config_var("maxsnaptrack", &sz1);
and it seems fine for getting the values (though I need to work out/be told how the bitmask(?) for GRID works, any tips welcome! .

Thanks for any help.

Sorry, it appears I don't know what I'm talking about. <:D

But on the PLUS side, it looks like there is a way of playing with things like snap settings. I've got a rudimentary POC plugin on the go which basically does something like this:

int *projshowgrid = (int *)get_config_var("projshowgrid", &sz);

if (*projshowgrid == 3327)

    // snap to nearby is ON: try turning it off

    *projshowgrid = 3199;

else if (*projshowgrid == 3199)

    // snap to nearby is OFF: try turning it on

    *projshowgrid = 3327;

I have no idea if this is safe, and I don't know how the numbers[0] should change depending on the various snap settings. But it seems to work, for now.

[0] That is, the numbers that follow GRID [here] in an RPP. (Is it a "bitmask", or something?)

Last edited by joe2; 12-02-2016 at 10:08 AM. Reason: Chatting rubbish
joe2 is offline   Reply With Quote