It looks like you're new here. If you want to get involved, click one of these buttons!
Hello Matthias,
my code should combine some DRC operations (booleans). It worked well in version 0.25 but in version 0.26 it throws me an error.
Here is the code:
`
comment: 2. Boolean Operation (Difference lr1 vs lr2)
lr1 = input(120,0)
lr2 = layout("@2").input(15,0)
target("@2")
diff = lr2-lr1
diff.output(15,0)
comment: 3. Boolean Operation (Union Layer15(@1) and Layer15(@2)
lr1 = input(15,0)
target("@1")
align = lr1.or(lr2)
align.output(15,0)
`
The Error Message:
Operation cancelled in Layout::get_info in MacroInterpreter::execute
C:/Users/.../KLayout/drc/greylines - cutout layer.lydrc:52:in execute_drc' :/built-in-macros/drc_interpreters.lym:18:in
instance_eval'
:/built-in-macros/drc_interpreters.lym:18:in execute_drc' :/built-in-macros/drc_interpreters.lym:65:in
execute'
It happens in step 3. But if I comment out step 3 it happens in step 2 already.
I hope you can help me with this.
Kind regards,
Christian
(Sorry for the bad editting)
Comments
Hi Christian,
I tried to reproduce the problem, but I failed. Here is the experiment by which I tried to grasp the problem:
I load two times the same layout into the same view. The layout has layer 1, so I have two identical layouts, each with layer 1. After I run this script, I get an empty layer 100 in layout 2 and a copy of layer 1 in layer 100 as expected. No error.
I'm using the most recent version, 0.26.3.
Is this the idea or am I doing something wrong?
Matthias
Your version works fine. But there is a difference to my code:
Then this error happens:
I guess I have to re-assign this new layer to lr2 in the second operation like in the following code:
But then I get another error and I don't know why:
Here is the full code I use in a DRC script:
Like before it works in 0.25 versions but not in 0.26.
Another thing I recognized: it works fine in both versions if some output operations are commented out (e.g. #sidestep).
Thanks for your help!
Christian
Hi Christian,
I'm afraid that's a bug.
The problem is the frequent switching of the target - usually there is just one target specification. But I admit this is a valid use case and should be supported.
I have created a ticket for this here: https://github.com/KLayout/klayout/issues/476
As a workaround (works for 0.26.3), you can use this piece of code in front of your DRC script. It will clear the list of output layers where the DRC script tracks the result layers upon "target" calls:
Please remove this code once the bug is fixed.
Kind regards,
Matthias
Thanks Matthias! It works now