jonathan

About

Username
jonathan
Joined
Visits
109
Last Active
Roles
Member

Comments

  • Thank you for the reply, I then ended up with then creating intermediate layers and copy these layers to the correct one, here is a sample code: lo = pya.LoadLayoutOptions()lm = pya.LayerMap()lm.map(pya.LayerInfo(9,70), 38, pya.LayerInfo(199,0))lo.…
  • Thanks for the link and the reply unfortunately the reverse does make sense to me, maybe the example above is not complete enough we could add a layer to map 1.0 -> 1001.0 because of such map the copy would force me to create an intermediate la…
  • It is now up but I could probably still comment: all amazing. I can see not much changes from the previous structure but a lot of great visual and even more comprehensive for all levels. If I could allow myself a remark it would be about searches t…
  • Hi thanks for the link, here is the code I made for sorting through layer number and datatype: def SortLayers(): lv = pya.LayoutView.current() to_insert = [] li = lv.begin_layers() while not li.at_end(): to_insert.append(li.current().dup())…
  • the issue was simply that we really need to ungrab mouse when the tool is deactivated: def deactivated(self): self.ungrab_mouse() If we forget to ungrab mouse and we switch tools then there is a bug, probably a conflict between the new mouse gra…
  • Hi @Matthias , I was looking at this layer search, it is very great, however there is indeed this issue the bindkeys. So I was wondering if there is a way to make it always visible from the start-up, or through a command (best case - I could just a…
  • Hi @crizos you are welcome, but I have to also thank you for highlighting the missing ungrab mouse which is quite important there. :)
  • Hi again @crizos, I tried the following code and it worked very good with my script: #this remove the tool from visibility: pya.MainWindow.instance().menu().action("@toolbar.set_origin").visible = False #you can start the tool with: pya…
  • Hi @crizos my post just crossed your edit, I will look at the code later but so far I only managed to grab mouse click from the pluginfactory which are tools, so I am not sure if there is a way to separate them.
  • Hi @crizos, when you are finished with your clicks just click on a another tool and you are set, you need a trigger anyway to say that you are done with your clicks, However you need to ungrab mouse when the tool is desactivated otherwise you will…
  • @crizos : If I understood you wish to have a sequence of actions on clicks and only quit the plugin at the end of it? what I would do for that would be to set up a variable which increment on each click and tells how far you are with the clicks. on …
  • Hello Matthias, Thanks again for the support: here I share again the result with the update: * handling mouse cursor is actually quite easy, I implemented a cursor which display also coordinates! * added an interface to snap the cursor to a grid *…
  • Thanks a lot Matthias it works great! I will just add to the answer for switching to the ruler tool (because of the question): pya.MainWindow.instance().menu().action("@toolbar.ruler").trigger()
  • Answering partially my own question: to make the Cursor not visible we can use pya.Cursor.Blank Why 'None' is listed in the available functions to pya.Cursor is not so clear however
  • Hello, here is a python code that gets the related Display to a given layer (number,datatype) def GetDispLayer(num,dt): li = pya.Application.instance().main_window().current_view().begin_layers() while not li.at_end(): lp = li.current() if…
  • Still adding a piece of code: pya.Cursor.Cross #compile without issuepya.Cursor.None #syntax error
  • Hello Mathias, Thank you very much for this answer! and sorry for coming back on it so late. I would like to now share the program I now have: * the program does not need to be run twice if the classes are written in the order. * There are some p…
  • Hi, I have only now learned about lambda, thank you so much for the help and the very useful and complete example scripts! :)
  • Thanks a lot again Matthias. all make more sense now. :o Overall, this would also means that, on the case I want to run a function with arguments, I should either create a new PushButton class with input argument or set the arguments as global va…
  • Hello Mathias: Thanks a lot! I now have all to set up the configuration up to my wishes. :)
  • I actually found the answer of my own question from browsing through unrelated questions: there is a file in my own ~/.klayout or C:/user/klayout which is created with each opening of Klayout, the file name 'klayoutrc', this file includes all the p…