图中是几个复杂多边形元素组成的两个不同的截面,我想通过代码实现放样曲面得到智能曲面然后转化成实体再通过差集特征生成一个箱型的实体。我查了帮助文档只找到了差集特征和转换成实体的方法,请问有放样曲面的方法或者类似的方法吗?
可以研究一下FromRailsAndSweptSections。进行Addins开发时,MicroStationVBA.chm是一个很好的帮助。
您好,我参照您的mdl代码写了一段c#代码,但是只画出来图片上的内容。我没学过mdl所以看不太懂mdl代码,尤其是给两端补面 形成体 (Cap Surface to form a Solid)那段代码,不知道如何转换成c#代码,希望您多多指教。
Application app = Utilities.ComApp; 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); oFitCurve.SetFitPoints(ref aFitPoints); oFitCurve.BesselTangents = true; aCurves[0] = new BsplineCurveClass(); aCurves[0].FromInterpolationCurve( oFitCurve); //创建断面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); oFitCurve.SetFitPoints (aFitPoints); oFitCurve.BesselTangents = true; aCurves[1] = new BsplineCurveClass(); aCurves[1].FromInterpolationCurve (oFitCurve); //创建侧面 BsplineSurface surface = new BsplineSurfaceClass(); surface.FromCrossSections(aCurves,MsdBsplineSurfaceDirection.U, 4, false, true); BsplineSurfaceElement oSurface = app.CreateBsplineSurfaceElement1(null, surface); oSurface.Color = 4; app.ActiveModelReference.AddElement(oSurface);