Load patterns are named collections of loads that can be analyzed independently or combined. They allow you to organize different load cases (dead load, live load, wind, etc.) and run multiple analyses efficiently.
model.add_point_load( node_id=3, load_pattern_name="LL", fx=5000.0, # Force in X direction (N) fy=-10000.0, # Force in Y direction (N) mz=2000.0, # Moment about Z axis (N·m) CSys="GLOBAL", # Coordinate system: "GLOBAL" or "LOCAL" replace=False # True to replace existing load)
Coordinate Systems
Global Coordinate System ("GLOBAL"):
X: Horizontal (typically left-right)
Y: Vertical (typically up-down)
Z: Out-of-plane (right-hand rule)
Local Coordinate System ("LOCAL"):
Aligned with node’s local axis (if defined)
Useful for inclined supports or non-orthogonal loading
model.add_distributed_load( member_id=1, load_pattern_name="DL", load_start=-5000.0, # Load at start (N/m) load_end=-5000.0, # Load at end (N/m) CSys="LOCAL", # "LOCAL" or "GLOBAL" direction="LOCAL_2", # Load direction load_type="FORCE", # "FORCE" or "MOMENT" replace=False)
# Uniform downward load on a beammodel.add_distributed_load( member_id=1, load_pattern_name="DL", load_start=-5000, load_end=-5000, direction="LOCAL_2")
2
Triangular load
# Triangular load (zero at start, max at end)model.add_distributed_load( member_id=2, load_pattern_name="WIND", load_start=0, load_end=-8000, direction="LOCAL_2")
3
Axial load
# Axial load along membermodel.add_distributed_load( member_id=3, load_pattern_name="THERMAL", load_start=1000, load_end=1000, direction="LOCAL_1")
model.add_cst_uniform_distributed_load( cst_id=1, load_pattern_name="PRESSURE", qx=1000.0, # Load in X direction (N/m²) qy=500.0 # Load in Y direction (N/m²))
# Uniform edge loadmodel.add_cst_uniform_edge_load( cst_id=1, load_pattern_name="WIND", q=5000.0, # Load magnitude (N/m) edge=1 # Edge number (1, 2, or 3))# Linear edge loadmodel.add_cst_linear_edge_load( cst_id=1, load_pattern_name="WIND", qi=2000.0, # Load at start of edge qj=8000.0, # Load at end of edge edge=2)
For triangular elements, edges are numbered 1-3 counter-clockwise starting from the first node.
While load patterns define individual load cases, you typically analyze combinations:
# Analyze each pattern independentlymodel.analysis.run_linear_static("DL")model.analysis.run_linear_static("LL")model.analysis.run_linear_static("WIND")# Results are stored separatelyresults_dl = model.results["DL"]results_ll = model.results["LL"]results_wind = model.results["WIND"]# Combine results manually for design# Example: 1.2*DL + 1.6*LL
milcapy currently stores results per load pattern. You can create load combinations by running multiple analyses and combining results using the linear superposition principle.