Hi Matthias,
I started to use scripting for my work recently. It is a very powerful tool for manipulating GDS layouts. But I stuck on copy of two layouts if they have different DBUs. Is there a simple way to do that, or I have to extract all shapes and then make scaling? Thanks a lot in advance.
Best regards,
TsannBim
Comments
Hello,
right now the easiest way to convert a layout to a different database unit is to write it to a temporary file and use the options provided by the '''writer''' to scale the layout:
You'll get a new layout file "tmp.oas" which will have the desired target database unit. You can then read the layout again.
That is some workaround for the lack of some simple function to scale a layout. Scaling a layout in-place is possible but slower since you'd have to do the scaling object by object.
Regards,
Matthias
Many thanks for your help. Ok, but your solution is a workaround, that means you plan to make a function for that? By the way, I am learning the KLayout objects and their methods/properties and also the way to control them, could you please show me how to deal with scaling of shapes one by one. Thanks again.
Regards,
Tsann-Bim
Hi,
I'll put the scaling function on my TODO list, but it has grown pretty long now. So I can't promise such a function soon.
If you want to scale a layout in code, here is a sample:
best regards,
Matthias
That is pretty clear and straightforward, and very helpful to me. Thank you so much for your kind help. Again, it is a great support from you.
Best regards,
Tsann-Bim