Enabling and disabling options
Posted: Tue Apr 14, 2015 11:37 am
Dear GiD-Team,
I have introduced two options to my problem type called "Generate" and "Simulate". The "Generate" option calls a Tcl-script that prepares my simulation (it does some rotations, creates several meshes and exports them). The Tcl-script then realoads the GiD-project in the state before execution of the script and enables the "Simulate" option (changes its color from grey to black). The "Simulate" option is coupled to "GiD_Process Mescape Utilities Calculate".
There are threething it would like to be able to do now:
1. First I would like to check the color of the "Simulate" option. If it is grey (not enabled after "Generate") I would like it to produce an error message. That means I need to get the options current color. How to do that?
2. If the "Simulate" option is enabled (it is black), I would like it to start the calculation (via "GiD_Process Mescape Utilities Calculate") from the current state where no mesh has been generated inside the project window. So I need to circumvent the "Don't forget to generate the mesh" function.
3. After anything changes (like "Changes to save(0/1): 1" in "GiD_Info list_entities PreStatus") I would like to automatically disable the "Simulate" option again. Is there a function like "AfterAnythingChange" combining function like AfterAssignMaterial?
Thanks for your help,
barnacle
I have introduced two options to my problem type called "Generate" and "Simulate". The "Generate" option calls a Tcl-script that prepares my simulation (it does some rotations, creates several meshes and exports them). The Tcl-script then realoads the GiD-project in the state before execution of the script and enables the "Simulate" option (changes its color from grey to black). The "Simulate" option is coupled to "GiD_Process Mescape Utilities Calculate".
There are threething it would like to be able to do now:
1. First I would like to check the color of the "Simulate" option. If it is grey (not enabled after "Generate") I would like it to produce an error message. That means I need to get the options current color. How to do that?
2. If the "Simulate" option is enabled (it is black), I would like it to start the calculation (via "GiD_Process Mescape Utilities Calculate") from the current state where no mesh has been generated inside the project window. So I need to circumvent the "Don't forget to generate the mesh" function.
3. After anything changes (like "Changes to save(0/1): 1" in "GiD_Info list_entities PreStatus") I would like to automatically disable the "Simulate" option again. Is there a function like "AfterAnythingChange" combining function like AfterAssignMaterial?
Thanks for your help,
barnacle