ravn

About

Username
ravn
Joined
Visits
125
Last Active
Roles
Member

Comments

  • Ah, found it. There is an error in my code. I must use the layer_indexes to get the correct number. This code works: view = pya.Application.instance().main_window().current_view()layout = view.cellview(0).layout()cell = view.cellview(0).cellfor idx…
  • This script does what you want. You need to edit the parameters to your liking: import pyaN = 4view = pya.Application.instance().main_window().current_view()layout = view.cellview(0).layout() # You do not need this for this scrip...cell = view.cell…
  • @demis , I can share some more information if you are interested. The code is not released to the general public yet as it is not mature enough, but the feature we are talking about here works well. If you are interested, send me an email robert.reh…
  • @Kumaran : This Python code seem to do the trick: if pya.CellView.active() is not None: ly = pya.CellView.active().layout() layers = ly.layer_indexes() for cell in ly.each_cell(): empty = True if cell.child_instances() > 0…
  • I see. It would probably be ok to update parameters in coerce_parameters_impl, but from what I can see that function is not called when cell.refresh is called. I am using cell.refresh to update the rendering of a cell from a file-system trigger when…
  • Ah, thanks. Clear. Given the constraints you describe above, this is probably not the way to do what I want. I continued to think about this and realized that hidden parameters in the PCell class looks like a better solutions. However, when playing…
  • Hi again @Matthias , thanks for the feedback. I will try to understand properly the mechanism behind how a library is instantiated in a layout since I now have bugged you with questions regarding this several times. Sorry about that. About the code…
  • If you want a short demonstration, send me and email and we can book a Zoom call. The library is for designing quantum processors. R.
  • Hi again, Seems it does not unfortunately: > pya.Application.instance().main_window().current_view().layout.setProperty(1, "Bar") Argument cannot be converted to a string in QObject_Native.setProperty (eval):1 Putting the 1 in quote…
  • @demis, We are working on a slightly different approach to this that might be interesting to you. This is a PDK that is under heavy development, so it is in no way production ready yet, but we have a way to generate very generic arrays. It can howev…
  • Thanks. I was trying this but did not quite manage. Please tell me if I misunderstand. I did: pya.Application.instance().main_window().current_view().layout.setProperty("Foo", "Bar") and then pya.Application.instance().main_windo…
  • @Matthias : Thanks. Our code is probably not ready for to public yet, there is still too much that needs to be polished, but we are aiming at FOSS'ing it once it has matured a bit more. It uses this feature that I explained in an earlier post (and …
  • Thanks for all support @Matthias! Now it works almost as expected :) I have some issue when creating a new library object, that is when I re-run the -lym-file. Not sure exactly how to describe the problem - it looks like the shapes generated from m…
  • Here is the code from the example Python PCell. Only changed where it is marked by <=========== import pyaimport mathfrom numpy.random import rand # <==========="""This sample PCell implements a library called "MyLib"…
  • Hi @Matthias, I tried this feature now. Unfortunately, it does not seem to work as I expected (I'm sure I misunderstood something). I am not sure what refresh does under the hood, but in my case, I could not see any change in the layout in the used…
  • Thanks for the fast feedback. What I wanted was really to document the code which is getting more contributors. So, I think Sphinx is a good options. I managed to resolve the issue in my second question by making a dummy pya-module that is placed i…
  • This is super! I will wait for 0.27.8.
  • Thanks Mattias, Can you point me to some documentation for me to understand where to put this code then? I have not understood I think where to execute that code. Thanks, Robert
  • Thanks Matthias, I tried this, but seems my hackish-solution cannot work with this approach. I get this error message: Object has been destroyed already in Layout.each_cell C:/.../src/pymacros/QTQC/QTQC Python parametric cells.lym:71 I guess thi…
  • Thanks for your great support! Kind regards, Robert
  • @Matthias. Thanks for your reply. I have attached the TestCell which I try to place and a full PCell that makes KLayout crash on Windows. Thanks for looking into this. import pyaimport mathclass PlaceCell(pya.PCellDeclarationHelper): def __init__(…
  • Thank you for your reply @Matthias. Unfortunately, I am not sure I understand. You wrote I cannot access layers from the PCell, but I can get a list of all layer indexes. Is it only that I cannot assign to them? The thing I want to do is to create a…
  • This is related to the other question that I asked (and got answered) and I think I understand now. Thanks. So I just need to turn off the debugger for my code to do what I want. Actually, I am fine with catching the exception in the PCell code. I n…
  • Ah, now I see. I was running the debugger, and it caught the exception. I was not aware of that. If I run my script with some error (e.g. like yours above) with the debugger on the above dialogue appears. If I run it from the IDE the dialogue appear…