visible grid levels

edited February 2015 in Layout
Is it possible to create a grid with minor and major grids to distingish 1um and 10um for instance ?

Comments

  • edited February 2015

    Hello,

    you mean snapping to 10 micron on low zoom levels and on 1 micron on high zoom levels?

    That's not possible right now, but I have some doubts regarding this, because a grid often is related to physical properties like resolution and cannot be negotiated.

    Matthias

  • edited November -1

    Might I suggest that there be an option to have every 10th dot be larger? That may visually serve the purpose intended by xamax. (e.g. if you are viewing a 1um grid of dots, the ones corresponding to 10um would be 3px instead of 1px.)

    If instead, xamax, you wanted to have a simultaneous major and minor grid to snap to (though, I'm not 100% sure how that would work), I have a code that allows quick switching between 0.1, 1, 100um grids by pressing "1","2","3" keys respectively. So while not simultaneous grids, they are easy to switch between. I can post the code later tonight or tomorrow.

  • edited February 2015

    Here is the quick grid switching code. It allows switching even in the middle of drawing. e.g. Start drawing a wire or something. Halfway through, press "1", "2", "3" and the next vertex will snap to the new grid.

    Perhaps there is an easier way than this script - let me know if so. Actually I have a somewhat more complicated scheme than the below, but here's the basic idea.

    "grid switcher.lym". Click Properties and make this one Run on Startup.

    # Instead of creating this .lym, tou can also just set the below via the GUI (in File>Setup) and it will remember. But at least knowing the script approach allows flexibility.
    
    # Remove a default keyboard shortcut for an item that would conflict with the below
    menu.action("zoom_menu.max_hier_1").shortcut = "/" # Usually has shortcut key "1", which I don't like so we overwrite that here. I use "/" such that "/" and "*" do opposite actions (show top level only, and show all levels, respectively).
    
    # Set the default grids. Put whatever you like.
    RBA::Application::instance.set_config("default-grids","100,1,0.001") 
    

    "grid 0.rb". Click properties and make this one have shortcut key "1"

    inst = RBA::Application::instance
    presets = inst.get_config("default-grids").split(',')
    inst.set_config("grid-micron", presets[0]) # Set the default grid to 1 nanometer
    

    "grid 1.rb". Click properties and make this one have shortcut key "2"

    inst = RBA::Application::instance
    presets = inst.get_config("default-grids").split(',')
    inst.set_config("grid-micron", presets[1]) # Set the default grid to 1 um
    

    "grid 2.rb". Click properties and make this one have shortcut key "3"

    inst = RBA::Application::instance
    presets = inst.get_config("default-grids").split(',')
    inst.set_config("grid-micron", presets[2]) # Set the default grid to 100 um
    
  • edited November -1

    Tanks for pasting these scripts. I got an request to make the grid shortcuts configurabe in the key bindings too, so that will be easier.

    Regarding the display features there are some ways of configuring the display styles differently on close zoom (when one grid corresponds so several pixels) and far zoom (when the grid is less that a few pixels). Maybe here already is somtehing for you.

    Matthias

  • edited February 2015
    Hi everyone,
    thank you for all your answers,
    I was actually refering to what david said about having one of every 10th dot or line be larger.
    I tried to have the shortcut working directly from the keybinding panel before and it did not work,
    so I abandoned the idea for the moment and expected it to work in the future thanks to the impressive
    work performed by matthias.
    Though your trick to have the shortcut to grid is very nice and I will surely make use of it, thank you for the code !
Sign In or Register to comment.