API reference question

After solving a model in an API, I need to use Zienkiewicz-Zhu Von Mises stress, but if the variable is not in the solution tree, the command
solution.node_value("zzvonmises", n)
return something with no type.
If I manually add Zienkiewicz-Zhu Von Mises stress to the solution tree it works fine, buy I don't want to do this manually.
Is there an API command to add an allready calculated variable (like Zienkiewicz-Zhu Von Mises stress) in the solution tree? or to make it possible to use with a command like
solution.node_value("zzvonmises", n)

Comments

  • Another question.
    Is there a command to delete unused nodes in an API?
  • There isn't a way to create a von Mises stress with the proper calculated values through a script without solving it again.

    You can add the Zienkiewicz-Zhu von Mises stress item to the outline tree with wrong values using

    solution.set_variable("zzvonmises", solution.all_nodes())

    then next time you solve, it'll put the correct values in.

    There also isn't currently a command to delete unused nodes. You could do it by iterating over the elements and storing the nodes that are used, then deleting the others. That wouldn't be exactly the same since it'd delete node-surface coupling reference nodes that aren't on elements.
  • edited September 11
    It is clearly not as good as an API command, but what i've done in the past for missing API commands that I absolutely wanted (like creating named selections for example) is writing a temporary .liml files and then import it in my main .liml file... and after that deleting the temporary .liml file...

    I think it could do the job if you add the script attached before solving...



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!