各位老师:
再上一个帖子中问过.NET接口中创建棱台实体..
那在COM接口中是否也有函数可以画棱台实体??
研究一下BsplineSurface.FromCrossSections。参见如下MDL代码的思路,它能绘制任意多个截面扫略而成的体,比简单的棱台体要通用的多。
https://communities.bentley.com/communities/other_communities/bdn_other_communities/b/bdn-blog/posts/creating-smartsolid-by-cross-sections
Answer Verified By: 超 上官
符工 是否可以根据这个https://communities.bentley.com/communities/other_communities/chinafirst/f/microstation-projectwise/141110/ms-ce-native/427985#427985
两个截面和一条路径做出棱台...请问除了C++函数外 还有其他的函数吗?
试试上边符老师说的BsplineSurface.FromCrossSections,这是c#里边的函数。
谢谢 郭工 符工 BsplineSurface.FromCrossSections可行
Point3d[] aFitPoints = new Point3d[4]; InterpolationCurve oFitCurve = new InterpolationCurveClass(); BsplineCurve[] aCurves = new BsplineCurve[2]; //创建断面1 aFitPoints[0] = app.Point3dFromXYZ(50, 50, 0); aFitPoints[1] = app.Point3dFromXYZ(50, -50, 0); aFitPoints[2] = app.Point3dFromXYZ(-50, -50, 0); aFitPoints[3] = app.Point3dFromXYZ(-50, 50, 0); ShapeElement s1 = app.CreateShapeElement1(null, aFitPoints); app.ActiveModelReference.AddElement(s1); aCurves[0] = new BsplineCurveClass(); aCurves[0].FromElement(s1); //创建断面2 aFitPoints[0] = app.Point3dFromXYZ(20, 20, 50); aFitPoints[1] = app.Point3dFromXYZ(20, -20, 50); aFitPoints[2] = app.Point3dFromXYZ(-20, -20, 50); aFitPoints[3] = app.Point3dFromXYZ(-20, 20, 50); ShapeElement s2 = app.CreateShapeElement1(null, aFitPoints); app.ActiveModelReference.AddElement(s2); aCurves[1] = new BsplineCurveClass(); aCurves[1].FromElement(s2); //创建侧面 BsplineSurface surface = new BsplineSurfaceClass(); surface.FromCrossSections(aCurves, MsdBsplineSurfaceDirection.U, 4, false, true); BsplineSurfaceElement oSurface = app.CreateBsplineSurfaceElement1(null, surface); oSurface.Color = 4; ElementEnumerator ee= app.SmartSolid.ConvertToSmartSolidElement(oSurface); SmartSolidElement sse = null; while (ee.MoveNext()) { if (ee.Current.IsSmartSolidElement) { sse = ee.Current.AsSmartSolidElement; sse.CapSurface(); app.ActiveModelReference.AddElement(sse); } }