It looks like you're new here. If you want to get involved, click one of these buttons!
Hello,
I would like to access some of the functionality of the Basic library (specifically, the text generation) from within the standalone python module.
Inside the application the following code should work
import klayout.db as pya
lay = pya.Layout()
top = lay.create_cell("TOP")
para = {"text": "Hello world", "mag": 1000, "layer": lay.layer(1, 0)}
pcell = lay.create_cell("TEXT", "Basic", para)
trans = pya.DCplxTrans.new(1, 0, False, 0, 0)
mycell = top.insert(pya.DCellInstArray.new(pcell.cell_index(), trans))
However, when used from the standalone module, it does not. The basic library does not seem to be exposed typically, (pya.Library.library_names() returns the empty list []), but I could also not find how I would load it.
Is there a way for me to load the Basic library from inside my standalone code?
Thanks a lot,
Clemens
Comments
Hi Clemens,
it's built-in in the main application, so you can't load it directly. I'll need to debug the reason it's not there. The ticket is: https://github.com/KLayout/klayout/issues/252
Thanks for reporting this,
Matthias
BTW: texts can be generated without basic lib using "TextGenerator". There was a similar issue with this, but that should be fixed (https://github.com/KLayout/klayout/issues/241).
Thanks a lot, I was not aware the TextGenerator existed, will give that a try.
Cheers,
Clemens
Thanks a lot, I was not aware the TextGenerator existed, will give that a try.
Cheers,
Clemens