STFLinearMemberList myMemberList = new STFLinearMemberList(); STFLinearMember myMember; Bentley.Interop.MicroStationDGN.Point3d pPt=new Bentley.Interop.MicroStationDGN.Point3d(); Bentley.Interop.MicroStationDGN.Point3d qPt = new Bentley.Interop.MicroStationDGN.Point3d(); STFSectionList sectionList = new STFSectionList(); STFSection section; section = sectionList.AsSTFSection; section.SetName("CAO5"); pPt.X = 0; qPt.X = 1000; pPt.Y = qPt.Y= 0; pPt.Z = qPt.Z = 0; myMember = myMemberList.AsSTFLinearMember; myMember.SetPQPoints(ref pPt,ref qPt); myMember.SetSTFSection(section); myMember.SetPlacementPoint(5); myMember.SetCrossSectionReflection(true); myMember.CreateTFFormRecipeList(); myMember.Save(false);
各位老师好,我正在摸索通过C#创建梁柱,查阅了以往的帖子写了如上代码,发现在CreateTFFormRecipeList处OBD会崩溃掉,请问应该如何修改,如有相关代码实例不胜感激,谢谢!
您看看这篇wiki是否能帮助到您:communities.bentley.com/.../sectionlist
开始我试过sectionList.InitFromTFSecMgr(),打印出sectionList数量1527个,但section的名称打印出来却是空,还是不知如何成功建模。
STFLinearMemberList myMemberList = new STFLinearMemberList(); STFLinearMember myMember; Bentley.Interop.MicroStationDGN.Point3d pPt=new Bentley.Interop.MicroStationDGN.Point3d(); Bentley.Interop.MicroStationDGN.Point3d qPt = new Bentley.Interop.MicroStationDGN.Point3d(); STFSectionList sectionList = new STFSectionList(); sectionList.InitFromTFSecMgr(); int iCount=sectionList.GetCount(); MessageBox.Show(iCount.ToString()); STFSection section; for (int i = 0; i < iCount; i++) { section = sectionList.GetSectionByIndex(i); MessageBox.Show(section.GetName()); }
这个看起来是c#的接口有问题,您可能得想办法调用c/c++的接口了
主要是在论坛有少量的C#参考,我也是按这么写的,不知道为啥不能建模
OBD开发还是首推C++,因为OBD SDK的例子大多数也是C++的,有些API本身就没有C# 的封装。
Answer Verified By: JiHong Duan