How can we define automatically an axial force result for all line bodies present in our model?

Erik Kostson
Erik Kostson Member, Moderator, Employee Posts: 327
50 Answers 100 Comments Second Anniversary 25 Likes
✭✭✭✭
edited March 19 in Structures

Say we have a model which includes line bodies. How can we automatically create an axial force result for each and every unsuppressed line body present in the model, using scripting?

Best Answer

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

    Below is one way of doing this:

    assm=DataModel.GeoData.Assemblies
    solution=Model.Analyses[0].Solution
    for my_assm in assm:
        for part in my_assm.AllParts:
            for body in part.Bodies:
                if body.Suppressed==False and str(body.BodyType)=="GeoBodyWire":
                    my_selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
                    my_selection.Ids = [body.Id]
                    resfx=solution.AddDirectionalAxialForce()
                    resfx.Location=my_selection
                    ExtAPI.SelectionManager.ClearSelection()
    
    
This discussion has been closed.