Autodesk.Revit.DB.Structure.IMemberForcesServer
是Revit API中用于获取结构元素受力信息的接口。
public interface IMemberForcesServer
返回类型:MemberForces
参数类型:Element
功能:获取指定结构元素的受力信息
异常:如果无法获取受力信息,则抛出异常
IMemberForcesServer server = new MemberForcesServer();
// 获取指定结构元素的受力信息
Element elem = ...;
MemberForces forces = server.GetMemberForces(elem);
// 输出受力信息
foreach (var loadCase in forces.LoadCases)
{
foreach (var force in loadCase.Forces)
{
Console.WriteLine($"Load Case Name: {loadCase.Name}");
Console.WriteLine($"Force Type: {force.ForceType}");
Console.WriteLine($"Value: {force.Value}");
}
}