function DrawArc() { //清空当前显示内容 mxOcx.NewFile(); //把颜色改回黑白色 mxOcx.DrawCADColorIndex = 0; //把线型改成实线 mxOcx.LineType = "" ; //设置线宽 4 mxOcx.LineWidth = 0; //创建一个图层,名为"ArcLayer" mxOcx.AddLayer( "ArcLayer" ); //设置当前图层为"ArcLayer" mxOcx.LayerName = ( "ArcLayer" ); //------------------------------------------------------------------------------------------------------------ //绘制一个实线黑色的圆弧 mxOcx.DrawArc1(0, 1000, 100, 30, 200); //-------------------------------------------------------------------------------------------------------------- //绘制一个虚线线的圆弧 mxOcx.AddLinetype( "ArcLineType" , "30,-5,7,-7" ); //设计当前线型为"ArcLineType" mxOcx.LineType = "ArcLineType" ; mxOcx.DrawCADColor = 435322; mxOcx.DrawArc1(300, 1000, 100, 30, 200); //--------------------------------------------------------------------------------------------------------------- //绘制一个有宽度的虚线线的圆弧 mxOcx.LineWidth = 15; mxOcx.DrawCADColor = 6335; mxOcx.DrawArc1(600, 1000, 100, 30, 200); //----------------------------------------------------------------------------------------------------------------- //由圆弧上三个点绘制圆弧 mxOcx.DrawArc2(800, 1000, 900, 1200, 1000, 900); //--------------------------------------------------------------------------------------------------------------- //由圆弧上的开始点,结束度和凸度会圆弧 mxOcx.LineType = "" ; mxOcx.LineWidth = 40; mxOcx.DrawCADColor = 65280; mxOcx.DrawArc3(1200, 1000, 1400, 1000, 0.6); //把所有的实体都放到当前显示视区 mxOcx.ZoomAll(); //更新视区显示 mxOcx.UpdateDisplay(); } |