CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ANSYS Meshing & Geometry (https://www.cfd-online.com/Forums/ansys-meshing/)
-   -   [ICEM] [Workbench] Access WB-parameter from ICEM replay script. (https://www.cfd-online.com/Forums/ansys-meshing/126304-workbench-access-wb-parameter-icem-replay-script.html)

AdamAL November 13, 2013 16:16

[Workbench] Access WB-parameter from ICEM replay script.
 
I am trying to use parameters specified in Design Modeller in an ICEM .rpl-script.

It is probably easier with an example:

In DM, i have defined My.width. This shows up in WB, and modifying it from WB correctly updates the geometry.
In ICEM's message window, I have tried typing:
Code:

set myParam  [ic_wb2_get_parameter user_defined My.width]
This doesn't work. I also tried replacing "My.Width" with its Parameter ID ("P1") - no luck.

I then created a parameter (calles "test") from within ICEM (settings>Workbench). Now I could get that with
Code:

set myParam  [ic_wb2_get_parameter user_defined test]
This parameter (test) showed up in WB instantly. And changing it in WB, also changes it in ICEM (though only after an [Update Project]).

This way, I could assign "P1" to "test" in the parameter expression window in WB. This does work - but is clunky in that it requires 3 operations (create param, create param, couple params) in 3 different programs - that adds up if there are many parameters.

So the question is: How can I access "My.width" directly from ICEM?

stuart23 November 13, 2013 17:07

Hi Adam,

I would probably steer away from using a variable name with a full stop in it.

You can try wrapping the variable name in curly brackets as in the following code:
Code:

set myParam  [ic_wb2_get_parameter user_defined {My.width}]

AdamAL November 14, 2013 03:02

Thanks for the suggestion, Stuart, but that's not it.

I tried renaming to "width", I also tried creating a parameter "test2" directly in WB. I was able to acces neither from ICEM. All I got was:
Code:

Result: ___NA___
- same result I get when entering non-existent names.

macfly November 16, 2013 21:56

Hi Adam,

Parametrization in DesignModeler (Parameter Manager) or Workbench (Parameter Set or Microsoft Excel parameter sheet) is pretty clunky as you already experienced.

If you can build your geometry in Icem, then you can write an Icem script and parameterize everything in there. Everything will be at the same place (parameters, geometry and meshing) and easy quick to modify. It takes a little time to get used to the Icem script commands, the TCL language and the poor Icem programmer's guide, but once you have mastered the basics you will never go back to Workbench!!

AdamAL November 19, 2013 06:45

Thanks François; I just might go that route.

Henry Arrigo October 14, 2014 14:29

Hi Adam
Did you finally resolve the problem. I have the same problem and I would appreciate if you share your solution.
thnks


All times are GMT -4. The time now is 00:32.