It looks like you're new here. If you want to get involved, click one of these buttons!
Hi
I have beginner's question. The goal is to draw shape in the specific layer (1,0) and then define layer (1,0) with better olor/stipple setting. However, one layer (1,0) is generated by "layout_view.insert_layer", then when I try to insert a shape, another (1,0) also shown up.....now I have 2 (1,0) layers with exactly the same shape in it.
thanks
#=============
include RBA
main_window = RBA::Application::instance.main_window
layout = main_window.create_layout(1).layout
layout_view = main_window.current_view
layout.dbu = 0.001
cell_index = layout.add_cell("TOP")
cell = layout.cell(cell_index)
unit_cell_index = layout.add_cell("Cell1")
unit_cell = layout.cell(unit_cell_index)
a = [RBA::Point::new(0,0),\
RBA::Point::new(100,0),\
RBA::Point::new(100,100),\
RBA::Point::new(300,300),\
RBA::Point::new(0,300),\
RBA::Point::new(50,150),\
]
ln = RBA::LayerPropertiesNode::new
ln.dither_pattern = 15
ln.fill_color = 0xffff00
ln.frame_color =0xffff0f
ln.width =1
#ln.source_layer_index = layer_index2
ln.source_layer = 1
ln.source_datatype = 0
layout_view.insert_layer(layout_view.end_layers, ln)
cell.shapes(layout.layer(1, 0)).insert(RBA::SimplePolygon::new(a ))
layout_view.select_cell(cell_index, 0)
layout_view.add_missing_layers
layout_view.max_hier
layout_view.zoom_fit
Comments
Hi,
thanks for this nicely prepared test case.
The problem is definitely not a beginner's question. The reason why the layer is not skipped in "add_missing_layers" is that you need to add the cellview index (the index of the layout loaded into one tab) to the source specification for it to become complete.
Here is my modified code (I took the liberty of some reformatting and removed the "include RBA" which is not required and will only pollute the system's global namespace:
Kind regards,
Matthias