Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Application note: automatically load a companion .lyp file

edited February 2011 in General

I have received several requests with an intention like that:

"Is is possible to automatically load a layer properties file when a layout 
file is loaded where the layer properties file is located beside the layout 
file and named like the layout file?

For example: if a layout file xyz.gds is loaded and there is a layer 
properties file xyz.lyp in the same directory, it should be loaded 
automatically."

Although there is no explicit option to do so, KLayout can be configured to
achieve this behavior.

To do so, open the Setup dialog, go to "Application", "Layer List". Check the "Use default layer" checkbox and enter the following text into the text box below the checkbox:

$(combine(path(layoutfile),basename(layoutfile))+".lyp")

In that case, the $(..) expression is evaluated and replaced by a path consisting of the layoutfile's directory ("path(x)"), the filename without extension ("basename(x)") and the extension ".lyp". "combine(a,b)" combines the path components using the system specific separator character.

Hence, the layer properties file is derived from the layout file in the desired way. If there is no such file, no specific layer properties file is loaded.

Matthias

Comments

Sign In or Register to comment.