It looks like you're new here. If you want to get involved, click one of these buttons!
Hi sir,
I just want to save some of layers into GDSII file
I knew that should using add_layer in the option of write command like below ,
But it is not workable.
Could you please let me know what is error in my code?
Thanks.
mw = RBA::Application::instance.main_window
mw.layout
view = mw.current_view
layoutfile = RBA::Application::instance.main_window.current_view.active_cellview.name
opt = RBA::SaveLayoutOptions::new
opt.format = "GDS2"
opt.keep_instances=true
opt.no_empty_cells=true
opt.gds2_max_vertex_count=4000
###################################################
ubm_index=0
layoutView = RBA::Application::instance.main_window.current_view.active_cellview.layout
layoutView.layer_indexes.each do |layer_index|
layer_info = layoutView.get_info(layer_index)
if layer_info.to_s.match("152/1") then
puts "The #{layer_index} mapping to #{layer_info}"
opt.add_layer(layout.layer(layer_index),layer_info)
end
end
layout.write("3361277.gds",opt)
Comments
Hi jiunnweiyeh,
An additional
opt.deselect_all_layers
line before you loop through layers should solved the issue.By default all layers are being selected during saving, you'll need to deselect them and add layers back like your example.
Hi @RawrRanger and @jiunnweiyeh,
That is correct, but actually the first "add_layer" would automatically imply "deselect_all_layers". So it is needed if the condition never matches. Maybe there is no layer "152/1" (or it is empty) in your case?
Matthias
Hi @Matthias
151/1 is not empty layer , and I got thse error message...
base on this code.
Hi All,
I got the answer , the code should be change to
opt.add_layer((layer_index),layer_info)