How to define a user defined result (udr) using cross section properties with mechanical scripting

Erik Kostson
Erik Kostson Member, Moderator, Employee Posts: 312
50 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭
edited February 13 in Structures

Say we have a beam model, that uses a cross section, and we want to get the section data (A, Ixx,..), in order to use it say in a udr?

Best Answer

  • Erik Kostson
    Erik Kostson Member, Moderator, Employee Posts: 312
    50 Answers 100 Comments Second Anniversary 25 Likes
    ✭✭✭✭
    Answer ✓

    Below is one way of doing it:

    model=ExtAPI.DataModel.Project.Model
    analysis = model.Analyses[0]
    csg=ExtAPI.DataModel.GetObjectsByType(Ansys.ACT.Automation.Mechanical.CrossSections)[0]
    cs1=csg.Children[0]
    ar=(cs1.PropertyByName("CrossSectionArea").StringValue).split(" ")[0]
    udr=analysis.Solution.AddUserDefinedResult()
    udr.Expression="(BEAM_AXIAL_FX)/"+str(ar)
    
This discussion has been closed.