我用之前访问xml的形式创建梁柱,发现在新结构模式下,通过接口获得的还是xml的配置,并无法获取新的mdb截面库的截面。请问是否有C#的接口去获得mdb截面库中的截面并创建梁柱?代码如下:
var linear = new Bentley.Interop.STFCom.STFLinearMemberList(); string option = ""; linear.Init(ref option); var beam = linear.AsSTFLinearMember;
Bentley.Interop.MicroStationDGN.Point3d point0, point1; point0.X = 0.0;//ar.startPnt.X + bar.insertPoint.X; point0.Y = 0.0;//ar.startPnt.Y + bar.insertPoint.Y; point0.Z = 0.0;//ar.startPnt.Z + bar.insertPoint.Z; point1.X = 1000.0;//ar.endPnt.X + bar.insertPoint.X; point1.Y = 0.0;//ar.endPnt.Y + bar.insertPoint.Y; point1.Z = 0.0;//bar.endPnt.Z + bar.insertPoint.Z;
double tmp_x = 0.0; double tmp_y = 0.0; string strSectionInfo = "400X600";// Util.GetSectionName(bar, sectionData);//必须放在前面 beam.SetCrossSectionReflection(false);//必须放在前面 beam.SetPQPoints(ref point0, ref point1); beam.SetSectionName(strSectionInfo); beam.SetPartFamily("Structural - Concrete"); beam.SetPartName("Insitu Concrete Beam"); beam.SetPlacementPoint(5); beam.SetRotation(0); beam.InitNamedProperties("Concrete Beam", "Beam"); beam.SetNamedPropertiesName("主梁", false); beam.AddToDgnExt(m_modelRef, true);
您试试如下代码是否能列出您在mdb库中配置的截面:
STFSectionList* pSectionList = mdlSTFSectionList_constructFromTFSecMgr(); if (pSectionList) { for (int i = 0; i < mdlSTFSectionList_getCount(pSectionList); i++) { STFSection* pSection = mdlSTFSectionList_getSectionByIndex(pSectionList, i); wprintf(L"Section%d: %s\n", i, mdlSTFSection_getName(pSection)); } mdlSTFSectionList_free(&pSectionList); }