> On 30 Oct 2020, at 15:28, Marco Antolovic <[email protected]> wrote:
> 
> Hi all,
> 
> Is there a way to delete a variable that you created in the GUI menu when you 
> reload the script?
> 
> I'll try to explain my question with this example:
> 
>  nr_dielectric_groups = DefineNumber[ 4, Min 1, Max 2000, Step 1, Name " 
> Dielectric parameters/Nr. of dielectric groups" ];
> 
> For i In {0:nr_dielectric_groups-1}
>     dielectric_thickness(i) = DefineNumber[ 550, Min 1, Max 2000, Step 1, 
> Name Sprintf(" Dielectric parameters/ Dielectric thickness %g", i+1) ];
> EndFor
> 
> when you first start the script dielectric_thickness() will be a vector of 
> dimension four and you will see four dielectric_thickness variables in the 
> menu.
> 
> However if I set nr_dielectric_groups=2 the menu will still show four 
> dielectric_thickness variables. Is there a way to delete excess variables 
> from the menu?
> 

You can "undefine" them using "UndefineConstant[]". But in practice we usually 
simply hide them (with the "Visible" attribute) : this way if you change your 
mind and later re-increase "nr_dielectric_groups", you will still have the 
value that you might have selected before.

Christophe



> Many thanks,
> 
> Marco
> 
> 
> _______________________________________________
> gmsh mailing list
> [email protected]
> http://onelab.info/mailman/listinfo/gmsh

— 
Prof. Christophe Geuzaine
University of Liege, Electrical Engineering and Computer Science 
http://people.montefiore.ulg.ac.be/geuzaine





_______________________________________________
gmsh mailing list
[email protected]
http://onelab.info/mailman/listinfo/gmsh

Reply via email to