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;// 连接到正在运行的 SAP2000mySapObject = (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读取结果