Ansys Mechanical Scrpting (Python): How to set direction of directional shear force?

Options
JW
JW Member Posts: 2
Name Dropper First Comment
edited June 2023 in Structures

Hello,

I am trying to create a beam result for a directional shear force (in y- & z-axis). But this options seems not to exist as a method (at least I can't find it in the API Reference Guide). For directional bending moments, it is easily possible:


yMoment = mySolution.AddDirectionalBendingMoment()

yMoment.NormalOrientation = NormalOrientationType.YAxis


How is it possible for the shear force? (And how to insert proper code representation in this forum?)

Thanks in advance!

Tagged:

Best Answer

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 813
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓
    Options

    Hi @JW ,

    You can use the following lines of code to insert a directional shear force:

    solution = ExtAPI.DataModel.Project.Model.Analyses[0].Solution
    new_res = solution.AddTotalShearForce()
    new_res.BeamResultType = TotalOrDirectional.Directional
    

    However, setting the "Orientation" of this result is not officialy exposed in the automation API (I will report this to our development team):

    As a workaround, you can use the unsupported commands below. By unsupported, we mean that they are not documented, and we do not guarantee that they will work.

    new_res.InternalObject.NormalOrientation = NormalOrientationType.ZAxis
    

    For using the forum text's editor, please refer to this post: https://discuss.ansys.com/discussion/1887/how-do-i-use-the-text-editor

    I hope this helps.

Answers