pCell parameters with drop-down menu & conditional flags

Hi,

I am very new at klayout anf python scripting but I have ideas about a junction model that I want to implement as a Pcell. Firstly I saw the discussion about creating a drop-down menu for a Pcell parameter shown below:

https://www.klayout.de/forum/discussion/1127/is-it-possible-to-make-pcell-parameters-have-radio-button-or-check-box-or-drop-down-menu#latest

But I had started my cell with python before I saw the discussion. Thus the syntax is invalid. Is there any accurate solution for python because I tried many things and klayout kept crashing.

Secondly, I am trying to change the hidden and readonly flags of the parameters conditionally. To give examples from the Figure below, I want to change the readonly state of the “d” parameter when the “a” parameter is changed. Or I want to open hidden parameters when the box at the bottom is checked.

I am trying to do these changes in “def coerce_parameters_impl(self):” part. I think this is probably an easy process and the actual problem is my lack of knowledge. If this is a spamming question I am sorry for my unproffessional approach, but I have to ask after all this time that I wasted.

Best regards.

Comments

  • edited March 2022

    Hi @ykopur,

    Right now, you simply cannot change the UI dynamically.

    This means, you cannot make parameters hidden or disabled conditionally. "coerce_parameters_impl" is not a callback in the sense Virtuoso implements it. It is only concerned with parameter values and is also employed outside the UI. It does not have connection to UI features.

Sign In or Register to comment.