-
-
January 10, 2025 at 8:44 amjoseph.mossSubscriber
Hi all,
I am currently creating a parametric tool on Workbench/Mechanical. For one of the parameters, I want its value to change based on the material selection of the body in the analysis. The material selection occurs by selecting the name of the material from a drop down menu. Here is the expression I am currently using:
-32.17117004 if P10 == "Titanium Alloy 15-3-3-3" else -47.87632636 if P10 == "Ti-64" else -43.21143658
This expression works, however it defaults to -43.21143658, as I don't think the strings I have input are recognised.
If I select the material to be Ti-64, and then use the expression P10 == "Ti-64" it returns as false.
This makes me think I am not referencing the selections from the drop-down menu properly. Does anyone know how to do this? Thanks
-
January 13, 2025 at 11:49 amJason LoganSubscriber
Â
Hi, Just to follow up as I’m working with Joe on this; and he's found a way around it (sort of).
To clarify we believe this issue is completely to do with trying to select from a dropdown menu; it just doesn’t recognise it as text. Since if I were to create a new parameter and put in the expression: P1, it returns this warning error:
There were ways around this error:
Â
- Either by using parameters we knew would change with each material type; i.e. mass of structure. And build the IF expression around that.
- Or, instead of a dropdown menu, assigning a new Master parameter with a value 1, 2, 3, etc and a master material entry with IF expressions for each material input (density/E/Poisson ratio), and other parameters that would change based on the Master parameter value.Â
-
January 13, 2025 at 5:42 pmTasos ZacharakisAnsys Employee
Hello Joe and Jason,
Â
The Workbench syntax rules for the parameters are described at : Expressions, Functions, Quantities, and Units. I understand it needs a numeric value within the expression to work.
Â
Thank you,
Tasos
-
- You must be logged in to reply to this topic.
- Error when opening saved Workbench project
- At least one body has been found to have only 1 element in at least 2 directions
- Script Error Code:800a000d
- Elastic limit load, Elastic-plastic limit load
- Element has excessive thickness change, distortion, is turning inside out
- Image to file in Mechanical is bugged and does not show text
-
1882
-
802
-
599
-
591
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.