How would we automate the extraction of section forces along a structure (say a column)?

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

How can we automatically create coordinate systems, construction surfaces + force reaction results scoped to these?

Best Answer

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

    Below is one way of doing this (sample script only - change as needed):

    model=ExtAPI.DataModel.Project.Model
    solution=model.Analyses[0].Solution
    constsurf = model.AddConstructionGeometry()
    
    for iz in range(1,20,2):
        testCS = model.CoordinateSystems.AddCoordinateSystem()
        testCS.CoordinateSystemType = CoordinateSystemTypeEnum.Cartesian
        testCS.OriginX = Quantity(0,"m")
        testCS.OriginY = Quantity(0,"m")
        testCS.OriginZ = Quantity(iz,"m")
        testCS.PrimaryAxisDefineBy = CoordinateSystemAlignmentType.GlobalX
        surf = constsurf.AddSurface()
        surf.CoordinateSystem = testCS
        forc = solution.AddForceReaction()
        forc.LocationMethod=LocationDefinitionMethod.Surface
        forc.SurfaceSelection=surf
        selection = ExtAPI.SelectionManager.CreateSelectionInfo(SelectionTypeEnum.GeometryEntities)
        mybod=ExtAPI.DataModel.GetObjectsByName('Solid')[0] # change name of Solid part
        selection.Ids = [mybod.GetGeoBody().Id]
        forc.GeometryLocation = selection
        forc.EvaluateAllResults()
        print('MaxTotal: '+ str(forc.MaximumTotal), 'Z-loc: ' + str(testCS.OriginZ))
    
    
This discussion has been closed.