yes, that's the way I'd do it too .. please note that skilled users could still do that in the macro IDE or potentially in other places. You'd not achieve total safety unless you disable these features too.
Some features that can potentially used to save layout:
DRC
Shapes to markers (save marker DB)
The net tracer (export nets)
If you include images:
Print
Save screenshot
And I'd bet a criminal mind could come up with many more options :-)
you can turn the script into a "generic macro" (*.lym file) and put it into ".klayout/macros". Such scripts can be configured to auto-run on start.
This file can be created using "Macros/Macro Development", "New Macro" ("+" button) and chose "Generic KLayout Macro" for the template. Rename the macro, paste your script text and in the macro properties (second tool button from the right above the macro text), enable "Run on startup".
Hi Luciano,
sorry, didn't read the KLayout forum during the last days.
Another way to make the script autorun is to place it as *.rbm in the program folder to make it active for all users running klayout from that folder,
or in your own KLayout folder, on Linux this should be ~/.klayout
that's right, but *.rbm is deprecated in favour of the autorun .lym version. The effect is the same, but there are more options with .lym (for example, you can use Python).
Are you maybe trying to run KLayout in batch mode?
"MainWindow" will not have an instance in that case. Hence RBA::Application::instance.main_window returns nil. In normal GUI mode, this should return the main window object.
Comments
Can you clarify your question? Do you *want* the buttons disabled, or for some reason they are disabled and you don't want them disabled?
Best regards, Erwin
Ok, I want the buttons disabled
Thanks
Luciano
have a look at the thread
https://www.klayout.de/forum/comments.php?DiscussionID=700
klayout_vo_app.exe should do what you are looking for.
regards
Stefan
On unix I used version 0.23.11 (the last one that I can use)
How can I use the script
mw = RBA::Application::instance.main_window
menu = mw.menu
menu.action("file_menu.save").visible = false
menu.action("file_menu.save_all").visible = false
menu.action("file_menu.save_as").visible = false
menu.action("@hcp_context_menu.save_cell_as").visible = false
on unix?
Many thanks in advance
Ciao
Luciano
Hi all,
yes, that's the way I'd do it too .. please note that skilled users could still do that in the macro IDE or potentially in other places. You'd not achieve total safety unless you disable these features too.
Some features that can potentially used to save layout:
If you include images:
And I'd bet a criminal mind could come up with many more options :-)
Matthias
But how can run the script on unix?
Many thanks in advance
Luciano
klayout -r myscript.rbm
but doesn't work
Please, can You help me?
Luciano
I have created file as myscript.rb and run it on this way
klayout -r myscript.rb
using this command "Save" and "Save As" are removed on menu "File"
Thanks to all.
Luciano
It's possible run the script automatically, inserting the name on klayoutrc file?
Thanks for the help in advance
Ciao
Luciano
Hi Luciano,
you can turn the script into a "generic macro" (*.lym file) and put it into ".klayout/macros". Such scripts can be configured to auto-run on start.
This file can be created using "Macros/Macro Development", "New Macro" ("+" button) and chose "Generic KLayout Macro" for the template. Rename the macro, paste your script text and in the macro properties (second tool button from the right above the macro text), enable "Run on startup".
Matthias
sorry, didn't read the KLayout forum during the last days.
Another way to make the script autorun is to place it as *.rbm in the program folder to make it active for all users running klayout from that folder,
or in your own KLayout folder, on Linux this should be ~/.klayout
regards
Stefan
Hi Stefan,
that's right, but *.rbm is deprecated in favour of the autorun .lym version. The effect is the same, but there are more options with .lym (for example, you can use Python).
Matthias
I'm tryng to use the same file on version 0.29.0 but I received this error message.
How can solve it??
Are you maybe trying to run KLayout in batch mode?
"MainWindow" will not have an instance in that case. Hence
RBA::Application::instance.main_window
returns nil. In normal GUI mode, this should return the main window object.Matthias
Running this command line
klayout -r myscript.rb
I don't know what "myscript.rb" is in your case, but this works for me:
myscript.rb:
Run KLayout with:
("klayout -r myscript.rb" does not start KLayout, but exits after the script is executed).
Matthias