Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorandyL
    • CommentTimeOct 18th 2017 edited
     
    I try to cut layers using the Points (p1,p2) of a ruler.
    So far I've go the result but I'm not able to delete the original shapes on the current layer.
    The script runs through without any error but still the original shape is in.

    Any idea is highly appreciated ...


    myLayer = layout.layer(1, 0)
    l0 = pya.Region()
    l0.insert(pya.Box(p1.x, p1.y ,p2.x+1000, p2.y+1000))

    l1 = layout.begin_shapes(topcell,myLayer)
    l2 = pya.Region(l1)
    result = l2-l0

    ####### Here I try to delete the original shapes
    shapes = topcell.shapes(myLayer)
    shapes.erase
    #topcell.shapes(lay).erase
    ########


    # insert modified shapes
    topcell.shapes(myLayer).insert(result)

    Thanks in advance,
    Andy
    • CommentAuthorMatthias
    • CommentTimeOct 19th 2017 edited
     

    Hi Andy,

    the solution is to clear the layer entirely:

    layout.clear_layer(myLayer)
    

    Matthias

    • CommentAuthorandyL
    • CommentTimeOct 19th 2017 edited
     
    Thanks a lot Matthias,
    It works as planned.


    With the programmable interface KLayout is a real outstanding tool !

    Cheers,
    Andy