How could I insert a cell without output layer?

edited December 1 in Ruby Scripting

It will work only when I output layer then read in, how could I make it work without create new layer?

darkpattern.or(outp).merged.output(93,300)
darkshape=input(93,300)

layoutView = RBA::Application::instance.main_window.current_view.active_cellview.layout
layout = RBA::CellView.active.layout
eachcells = layout.each_cell
darkSMEErename="Dark_SMEE_rename" 

  if !layoutView.has_cell?(darkSMEErename) then
  layoutView.create_cell(darkSMEErename)
  cell(darkSMEErename)
  dark = layout.layer(93,0)
  top = layout.cell(darkSMEErename)
  darkshape.data.each do |pp|
  top.shapes(dark).insert( RBA::Polygon::new(pp))

  placeme = source.layout.cell(darkSMEErename) 
  source.cell_obj.insert(RBA::CellInstArray::new(placeme.cell_index, RBA::Trans::new(0,0)))
  end
  end

Comments

  • edited December 1
    LayoutView = RBA::Application::instance.main_window.current_view.active_cellview.layout
    
    
    dialog = RBA::QDialog.new( RBA::Application.instance.main_window)
    
    
    dialog.windowTitle = "QLE Dark SMEE 2024-11-27"
    
    
    layout = RBA::QVBoxLayout::new(dialog)
    
    
    dialog.setLayout(layout)
    
    
    layer_list= Array.new()
    
    
      view = RBA::LayoutView::current
    
    
       li = view.begin_layers
    
    
      while !li.at_end?
    
    
       lp = li.current
    
    
         layer_list << "#{lp.source_layer}/#{lp.source_datatype}"
    
    
       li.next   
    
    
    end
    
    
    ##############################################################
    
    
            label =  RBA::QLabel.new(dialog)
    
    
            layout.addWidget(label)
    
    
            label.text = "输入参考 Shot/PKG/DIE 图层"
    
    
            layercase1 =  RBA::QComboBox.new(dialog)
    
    
            layer_list.each do |subcell|
    
    
            layercase1.addItem(subcell)
    
    
            end
    
    
            layout.addWidget(layercase1)
    
    
            layercase1.currentText="73/0"
    
    
    
    
    
          label =  RBA::QLabel.new(dialog)
    
    
            layout.addWidget(label)
    
    
            label.text = "輸入向上方size尺寸"
    
    
            up =  RBA::QLineEdit.new(dialog)
    
    
            layout.addWidget(up)
    
    
            up.text="10"
    
    
    
    
    
          label =  RBA::QLabel.new(dialog)
    
    
            layout.addWidget(label)
    
    
            label.text = "輸入向下方size尺寸"
    
    
            down =  RBA::QLineEdit.new(dialog)
    
    
            layout.addWidget(down)
    
    
            down.text="10"
    
    
    
    
    
          label =  RBA::QLabel.new(dialog)
    
    
            layout.addWidget(label)
    
    
            label.text = "輸入向左方size尺寸"
    
    
            left =  RBA::QLineEdit.new(dialog)
    
    
            layout.addWidget(left)
    
    
            left.text="10"
    
    
    
    
    
          label =  RBA::QLabel.new(dialog)
    
    
            layout.addWidget(label)
    
    
            label.text = "輸入向右方size尺寸"
    
    
            right =  RBA::QLineEdit.new(dialog)
    
    
            layout.addWidget(right)
    
    
            up.text="10"
    
    
    #######################################
    
    
    
    
    
            buttonOK = RBA::QPushButton.new(dialog)
    
    
            layout.addWidget(buttonOK)
    
    
            buttonOK.text = " OK "
    
    
            buttonOK.clicked do
    
    
    
    
    
    
    
    
    layout = RBA::CellView.active.layout
    
    
    layercase1=layercase1.currentText
    
    
    up=up.text.to_f
    
    
    down=down.text.to_f
    
    
    left=left.text.to_f
    
    
    right=right.text.to_f
    
    
    area_num=layercase1.split("/")[0].to_i
    
    
    area_pur=layercase1.split("/")[1].to_i
    
    
    
    
    
    fields=input(91,0)
    
    
    shot=input(area_num,area_pur)
    
    
    os=input(area_num,area_pur)
    
    
    
    
    
    sup=(shot.size(0.micron,(up/2).micron)).move(0.um,(up/2).um)
    
    
    sdown=(sup.size(0.micron,(down/2).micron)).move(0.um,-(down/2).um)
    
    
    sleft=(sdown.size((left/2).micron,0.micron)).move(-(left/2).um,0.um)
    
    
    sright=(sleft.size((right/2).micron,0.micron)).move((right/2).um,0.um)
    
    
    allsize=sright
    
    
    
    
    
    darkpattern=fields.not(allsize)
    
    
    miss=fields.not(darkpattern).not(os)
    
    
    #######################################
    
    
    look =1
    
    
    outp = polygon_layer
    
    
    miss.data.each do |xx|
    
    
    if xx.area<50000000000 then
    
    
     outp.data.insert(xx)
    
    
    end
    
    
    end
    
    
    ###########################################
    
    
    #miss.output(93,100)
    
    
    darkshape=darkpattern.or(outp).merged
    
    
    #darkpattern.or(outp).merged.output(93,300)
    
    
    #darkshape=input(93,300)
    
    
    ########################################## 
    
    
    layoutView = RBA::Application::instance.main_window.current_view.active_cellview.layout
    
    
    layout = RBA::CellView.active.layout
    
    
    eachcells = layout.each_cell
    
    
    darkSMEErename="Dark_SMEE_rename" 
    
    
    
    
    
      if !layoutView.has_cell?(darkSMEErename) then
    
    
      layoutView.create_cell(darkSMEErename)
    
    
      cell(darkSMEErename)
    
    
      dark = layout.layer(93,0)
    
    
      top = layout.cell(darkSMEErename)
    
    
      darkshape.data.each do |pp|
    
    
      top.shapes(dark).insert( RBA::Polygon::new(pp))
    
    
    
    
    
      placeme = source.layout.cell(darkSMEErename) 
    
    
      source.cell_obj.insert(RBA::CellInstArray::new(placeme.cell_index, RBA::Trans::new(0,0)))
    
    
      end
    
    
      end
    
    
    
    
    
    
    
    
    
    
    
    ##########################################  
    
    
    dialog.accept
    
    
    end 
    
    
    
    
    
      buttonOK = RBA::QPushButton.new(dialog)
    
    
      layout.addWidget(buttonOK)
    
    
      buttonOK.text = " Cancel "
    
    
      buttonOK.clicked do 
    
    
      dialog.accept
    
    
      end 
    
    
      dialog.exec
    
  • Hi illyjustfine
    @illyjustfine try this code.

    LayoutView = RBA::Application::instance.main_window.current_view.active_cellview.layout
    current_work_cell= RBA::Application::instance.main_window.current_view.active_cellview.cell_name
    dialog = RBA::QDialog.new( RBA::Application.instance.main_window)
    dialog.windowTitle = "QLE Dark SMEE 2024-11-27"
    layout = RBA::QVBoxLayout::new(dialog)
    dialog.setLayout(layout)
    layer_list= Array.new()
    view = RBA::LayoutView::current
    li = view.begin_layers
    while !li.at_end?
    lp = li.current
     layer_list << "#{lp.source_layer}/#{lp.source_datatype}"
    li.next
    end
    
      label =  RBA::QLabel.new(dialog)
      layout.addWidget(label)
      label.text = "Enter refere Shot/PKG/DIE layer"
      layercase1 =  RBA::QComboBox.new(dialog)
      layer_list.each do |subcell|
      layercase1.addItem(subcell)
      end
    
      layout.addWidget(layercase1)
      layercase1.currentText="73/0"
      label =  RBA::QLabel.new(dialog)
      layout.addWidget(label)
      label.text = "enter TOP size of dark"
      up =  RBA::QLineEdit.new(dialog)
      layout.addWidget(up)
      up.text="10"
    
      label =  RBA::QLabel.new(dialog)
      layout.addWidget(label)
      label.text = "enter DOWN size of dark"
      down =  RBA::QLineEdit.new(dialog)
      layout.addWidget(down)
      down.text="10"
    
      label =  RBA::QLabel.new(dialog)
      layout.addWidget(label)
      label.text = "enter LEFT size of dark"
      left =  RBA::QLineEdit.new(dialog)
      layout.addWidget(left)
      left.text="10"
    
      label =  RBA::QLabel.new(dialog)
      layout.addWidget(label)
      label.text = "enter RIGHT size of dark"
      right =  RBA::QLineEdit.new(dialog)
      layout.addWidget(right)
      right.text="10"
    
      buttonOK = RBA::QPushButton.new(dialog)
      layout.addWidget(buttonOK)
      buttonOK.text = " OK "
    
       buttonOK.clicked do
    layout = RBA::CellView.active.layout
    layercase1=layercase1.currentText
    up=up.text.to_f
    down=down.text.to_f
    left=left.text.to_f
    right=right.text.to_f
    area_num=layercase1.split("/")[0].to_i
    area_pur=layercase1.split("/")[1].to_i
    fields=input(91,0)
    shot=input(area_num,area_pur)
    os=input(area_num,area_pur)
    sup=(shot.size(0.micron,(up/2).micron)).move(0.um,(up/2).um)
    sdown=(sup.size(0.micron,(down/2).micron)).move(0.um,-(down/2).um)
    sleft=(sdown.size((left/2).micron,0.micron)).move(-(left/2).um,0.um)
    sright=(sleft.size((right/2).micron,0.micron)).move((right/2).um,0.um)
    allsize=sright
    darkpattern=fields.not(allsize)
    miss=fields.not(darkpattern).not(os)
    
    look =1
    outp = polygon_layer
    miss.data.each do |xx|
    if xx.area<50000000000 then
    outp.data.insert(xx)
    end
    
    end
    
    #
    miss.output(93,100)
    darkshape=darkpattern.or(outp).merged
    darkpattern.or(outp).merged.output(93,300)
    darkshape=input(93,300)
    #
    layoutView = RBA::Application::instance.main_window.current_view.active_cellview.layout
    layout = RBA::CellView.active.layout
    eachcells = layout.each_cell
    darkSMEErename="Dark_SMEE_rename"
    if !layoutView.has_cell?(darkSMEErename) then
    layoutView.create_cell(darkSMEErename)
    cell(darkSMEErename)
    dark = layout.layer(93,0)
    top = layout.cell(darkSMEErename)
    darkshape.data.each do |pp|
    top.shapes(dark).insert( RBA::Polygon::new(pp))
    end
    end
    
    cell(current_work_cell)
    placeme = source.layout.cell(darkSMEErename)
    source.cell_obj.insert(RBA::CellInstArray::new(placeme.cell_index, RBA::Trans::new(0,0)))
    
    
    dialog.accept
    end
    buttonOK = RBA::QPushButton.new(dialog)
    layout.addWidget(buttonOK)
    buttonOK.text = " Cancel "
    buttonOK.clicked do
    dialog.accept
    end
    dialog.exec
    
  • I took the liberty to edit the discussion entries, so the code is formatted properly.

    @illyjustfine You have to use Markdown notation (a line with triple backticks before and after the code). Same as GitHub uses for example.

Sign In or Register to comment.