private void RunScript(bool build, ref object p1, ref object p2, ref object Profile, ref object stressRatio, ref object temperatureLoad, ref object displacement, ref object frameList)
{
if (build == true)
{
// 声明变量
int ret;
int Numit = 0;
int[] ObjType = new int[0];
string[] ObjName = new string[0];
cOAPI mySapObject = null;
// 连接到正在运行的 SAP2000
mySapObject = (cOAPI) System.Runtime.InteropServices.Marshal.GetActiveObject("CSI.SAP2000.API.SapObject");
cSapModel mySapModel;
mySapModel = mySapObject.SapModel;
//解锁
mySapModel.SetModelIsLocked(false);
// 执行一次计算
ret = mySapModel.Analyze.RunAnalysis();
//全选所有对象
mySapModel.SelectObj.All(false);
// 获取选中的对象(全选/框选)
ret = mySapModel.SelectObj.GetSelected(ref Numit, ref ObjType, ref ObjName);
// 声明所需变量
string[] framenamelist = new string[10]; //[10]是什么意思?
int count = 0;
//1.获取单元编号
mySapModel.FrameObj.GetNameList(ref count, ref framenamelist);
frameList = framenamelist;
// SecList 应该是 string[] 类型
string[] FrameList = frameList as string[];
}
-
SAP2000模型
-
Rhino读取结果