parameters are not defined in instance macro

edited May 19 in Ruby Scripting


When I declare some parameters, it seems not to be created.
Even when I change default value of parameter, previous value is still remained.

# MinFlags
    param(:viaSourceMinFlag, TypeBoolean, "viaSourceMinFlag", :default => false)
    param(:ohmSourceMinFlag, TypeBoolean, "ohmSourceMinFlag", :default => false)
    param(:nSourceGapMinFlag, TypeBoolean, "nSourceGapMinFlag", :default => false)
    param(:nSourceMinFlag, TypeBoolean, "nSourceMinFlag", :default => false)
    param(:pPlusMinFlag, TypeBoolean, "pPlusMinFlag", :default => false)
    param(:trenchMinFlag, TypeBoolean, "trenchMinFlag", :default => false)
    param(:pWellMinFlag, TypeBoolean, "pWellMinFlag", :default => false)
    param(:ohmGateMinFlag, TypeBoolean, "ohmGateMinFlag", :default => false)
    param(:totalnSource, TypeBoolean, "totalnSource")

this is my parameters, and now, I can only check declaration of "viaSourceMinFlag" by printing it.
other parameters do not show its value which is false.

As I said before, when i change the parameter, the changed value seems not to be synced.

When I modify the code, then I run it by "run script from the current tap", and it runs well.
How do I do for updating modified parameters?

At the first time, I set them as hidden, but when I removed the option, then I could see viaSourceMinFlag has "false" value.

    param(:rule8, TypeDouble, "Rule 8", :default => 1.0)

and this is another example of my problem.
as you see, the default value was 1.0. but it was 1.5 previously.
However, my instance keep having 1.5 not 1.0. so, I commented it out, and set it back, then my instance has 1.0.

Does the system save any value or do i do something wrong?


  • edited May 19

    if you need more info or full code, I can share you.
    Just wanna avoid massing the post up

  • Hi,

    first of all, the system saves the last settings. In order to get the default values you need to make the system forget the parameters.

    You can reset the parameters by switching to a different library and back for example.

    Is this what you're asking?


  • Thank you very much,

    Or is there any way to reset values by the code at the beginning?
    I mean, when user make the instance, it reset only one time.

  • edited May 25

    You can try this:

    pya.Application.instance().set_config("edit-inst-pcell-parameters", "")

    Put this line somewhere in your script, for example where the library is registered. This line will reset any PCell parameters kept in the system.


  • Hello,

    I have still same problem on assigning value to variables.
    Is the way how I assign wrong to Boolean type variables?

    Double, Int values are good, but only boolean type variables are not assigned.

    please correct where I am wrong or what have to do


  • I'm sorry, but I don't see your code neither do I see the code line where your breakpoint is set.

    I can't confirm the problem with my own sample:

    There are some known bugs and stability issues so I discourage use of KLayout on MacOS.


Sign In or Register to comment.