Hi @Matthias,
Let's say that we have the following scenarios:
Scenario A: filename invalidation - empty string
main_window = pya.Application.instance().main_window()main_window.load_layout(gds_path, 0)layoutview = main_window.current_view()cellvi…
Hi @sekigawa,
Thank you for your input in this matter.
I tend to believe that this is more of a bug since the info of the loaded filepath has been used as input to pya.Layout object in initialization, and cannot be retrieved somehow as far as I kn…
Hi Matthias,
Actually, you helped me with your last suggestion to copy the Layout object and reset that one when I have to revert to a checkpoint. I was misguided that I must use the CellView somehow since that has the is_dirty flag. Your direction…
Hi Matthias,
I tried reloading, but I usually edit large files and I'm trying to avoid reopening/reloading which is the reason for reverting/deleting staff. Can you give an example of your suggestion for copying the layout? Would e.g. the text labe…
I have a follow-up question on this one:
Let's say we reach state A, we are saving in that state (by any means), and we do some actions B and C, which are first required to be done in a saved environment but not save the outcome of these actions.
…
Thank you Matthias, it worked.
For the first part, is there any other way to understand that changes exist other than manager().has_undo() after saving? Not only by code but also with File->Save or Ctrl+S. For example, I see a [+] in the tab tit…
Is there any other way to understand that changes exist other than manager().has_undo() after saving? cm_save does not change the undo state, and neither can turn off the action manually. Can we reset the undo state after saving, or do we have somet…
Hi all.
Looking back at the documentation, my issue may lie in the fact that I do not have a menu entry but only trigger it by code (creating only a hidden tool button in the toolbar), and for each view I create, it also creates a new plugin (?). S…
Hi Matthias,
Ok, I thought that it is possible to create a layer to the main layout from wherever you are, whenever you want.
Thank you for your answer, I think this will be my solution to this issue thank you.
Chris
(Quote)
You are right that wasn't the issue. Firstly I wanted to move the plugin from toolbar to menu, as Tools option, so I set variable has_tool_entry to False and then I used add_menu_entry.
So, from what I understand, if has_tool_entry is False…
Hi @jonathan,
You are right, thank you very much for this answer! This unlocked my misunderstanding issue about deactivation! I had never tried to hide the plugin from the toolbar itself, so it made things more complicated than it should. I still h…
Hi @jonathan,
Thank you for reposting the code,
Yes, the bug, or the reason why my implementation doesn't work, may rest in the difference that my plugin does not have a tool entry in the toolbar. The triggering should be happening from a function…
@jonathan : Yes, you are correct, and as for the counting variable, I don't have finite steps in my implementation, but even so, I still think that I would have the same problem in reactivation.
I want to enable the plugin e.g. menu.action('somewhe…
Hi all,
@Matthias, I tried your suggestions unsuccessfully, but I managed to deactivate the plugin destroying the instance, by running SetOriginOnMouseClickPluginFactory.instance._destroy() instead of self._destroy(), without making KLayout crash. …
Hi Matthias,
Well, as for the contents of the failure message, I've developed something using display_text_impl, but it is not about the text message only. I want to display a box, with a corresponding blinking effect, to indicate that something we…
Hi,
Sorry for not opening a new thread, I think that the answer will be good to be posted under the current thread for completeness.
Let's say that we want to use buttons states for several jobs, and e.g. pya.ButtonState.RightButton click to deact…
Hi Matthias,
OK, I see.
For development purposes, it is just fine, but I don't want the user seeing "internal" failures. It is more UX friendly to prompt a "black box" failure.
Chris
Hi Matthias,
Thank you for confirming that this function should work, as I thought that this is the part of my code I should put my efforts on to correct, and for your enhancement comments.
I updated my version with your last two comments, but as …
Hi Matthias,
I'm still using 0.25.9, didn't had the chance to update yet. I will try 0.26 and I' ll come back to this thread if necessary.
Thanks Matthias,
Chris
The simplest function that also helped me find this issue is the following:
def is_number(item) : ''' Description: Checks if the given 'item' represents a number. --- returns: Boolean status [True|False] ''' try: float(item…
Hi Matthias,
(I'm Chris by the way :p )
No, in the original post I was saying that I've created a function which prepares a pcell instance for the user to drag&drop it into the layout from Cells Category. But it seems that I can't double-insta…
Hi Sebastian!
Preferably, I wanted a way either instantiate the pcell overcoming this issue, or somehow, to got a response that will say that the pcell instantiation failed because it is already there.
Not an ideal scenario, but this is what I will…
I think that I was able to confirm that really that was the case. Surprisingly, Error Handling do not work if the layout is created by code. A "workaround" that seems to work for now is to add finally keyword:
try: ...except: ...finally: …