We’re putting the final touches on our new badges platform. Badge issuance remains temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.
General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Workbench Parameter Set Expressions

    • joseph.moss
      Subscriber

      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

    • Jason Logan
      Subscriber

       

      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. 
    • Tasos Zacharakis
      Ansys 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

Viewing 2 reply threads
  • You must be logged in to reply to this topic.