Change "Load Layer Properties" search priority

edited April 2014 in Ruby Scripting
In linux (RH5.8) when menu button "File"->"Load Layer Properties" is clicked, the popping up browsing form is searching initially in the folder where the klayout is started.

How can be the initial searching folder to be changed to some other folder.

The idea is that I want to store all the .lyp files of different technologies in some centralized folder.
And "Load Layer Properties" browsing form to open directly from it.

Comments

  • edited April 2014

    Hi,

    The solution is that simple script:

    file = RBA::FileDialog::ask_open_file_name(
      "Select Layer Properties File", 
      "c:\\",  # Enter your favorite folder here 
      "Layer Properties Files (*.lyp);;All Files (*)"
    )
    file && RBA::LayoutView::current.load_layer_props(file)
    

    To quickly select a certain layer configuration (and more) you may also consider using technology setups. See http://klayout.de/doc/about/technology_manager.html for an introduction.

    Matthias

  • edited November -1
    Hello Matthias,

    Thanks for the script, but it is not exactly what I need.
    If I create it as a .rbm file it is loaded and launched during Klayout startup, but in that time still there is not GDS file opened.

    I need that pre-defined initial search folder to be default whenever "File"->"Load Layer Properties" is clicked.

    Stoyan
  • edited April 2014

    Perhaps the easiest way is to take that script, and make it appear in the menus. You could even put it just above "File" > "Load layer properties". So you could call it "Load My layout properties" or something different, and have it show up in the same menu.

    To do that, make a new .lym file. Paste in the script. Click that orange button on top in macro editor to change the settings for the lym file. Type something for description -- like "Load MY Layer properties". Set "Show in menu" to checked. Type the following in "path" box:

    file_menu.load_layer_props
    

    That will put it before that item in the menu.

    I guess then the question is, why is this not configurable in the Settings? Why do I have to write a script and then register it as a menu item? Well I didn't create the settings but I guess the answer is probably: it's always a difficult trade-off to know what to allow the user to change and what to not. If they can change absolutely everything then things can get rather confusing. If they can change nothing then that sucks too. So the happy medium is somewhere in the middle.

    HTH
    David

  • edited November -1
    Thanks david234589,

    The approach is working.

    tyanata
  • edited November -1

    Hi David,

    thank you for mentioning this. I forgot to be explicit about the details.

    Best regards,

    Matthias

Sign In or Register to comment.