How to change the GDS layer?

Hi sir ,
as below , I want to change a GDS layer number from X to 500+X.
after running this script , that is not workable.
Could you please help to check it if any problem in the code?
Thanks.

mw = RBA::Application::instance.main_window
mw.layout
view = mw.current_view
layer_list= Array.new()
view = RBA::LayoutView::current
li = view.begin_layers
while !li.at_end?
lp = li.current
#puts "#{lp.source_layer} #{lp.source_datatype}"
lp.source_layer=lp.source_layer+500
li.next
end

Comments

  • edited April 2024

    Hi @jiunnweiyeh,

    This script changes what layer are displayed, not the layers themselves.

    So you need to change both the layer number of the layer displayed and the layer number in the database:

    mw = RBA::Application::instance.main_window
    
    view = RBA::LayoutView::current
    view.each_layer do |l|
    
      # change layer number of database
      cv = view.cellview(l.cellview)
      ly = cv.layout
      li = ly.get_info(l.layer_index)
      li.layer += 500
      ly.set_info(l.layer_index, li)
    
      # change what layer is displayed  
      l.source_layer += 500
    
    end
    

    Disclaimer: this does not work if you have the same layer displayed multiple times and will only change the layers in the layer list.

    Matthias

Sign In or Register to comment.