当前位置: 首页>>代码示例>>C#>>正文


C# ModelDoc2.IAddVerticalDimension2方法代码示例

本文整理汇总了C#中ModelDoc2.IAddVerticalDimension2方法的典型用法代码示例。如果您正苦于以下问题:C# ModelDoc2.IAddVerticalDimension2方法的具体用法?C# ModelDoc2.IAddVerticalDimension2怎么用?C# ModelDoc2.IAddVerticalDimension2使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ModelDoc2的用法示例。


在下文中一共展示了ModelDoc2.IAddVerticalDimension2方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetDimensionLineDirect

        public double[] GetDimensionLineDirect(ModelDoc2 swModel, double[] boundBox, bool vertic,BlockPosition side, out double d, out Annotation annotation,out bool? blockSize,out Ordinate vertex,out Ordinate vertexS,  double[] dsDim,double[] deDim,double[] endDim,string dsName,string deName)
        {
            blockSize = null;
            var swDrawing = (DrawingDoc) swModel;
            var drView = swDrawing.IActiveDrawingView;
            var scale = (double[]) drView.ScaleRatio;
            double vScaleRat = scale[1];
            double[] doubles = null;
            d = 0;
            annotation = null;

            vertex = GetVertexFromBlock(swModel, drView, vScaleRat,true);
            if(!(vertex!=null && SelectVertexDatum(swModel, vertex)))
                vertex = SelectVertexDatumUp(swModel, boundBox, side);

            if (dsDim != null && deDim != null)
            {
                vertexS = GetVertexFromBlock(swModel, drView, vScaleRat, false);
                //swModel.ClearSelection2(true);

                swDrawing.ActivateView(drView.Name);
                bool tmp = swModel.Extension.SelectByID2(@"Точка вставки/" + dsName, "SKETCHPOINT", 0, 0, 0, false, 0, null, 0);
                tmp = swModel.Extension.SelectByID2(@"Точка вставки/" + deName, "SKETCHPOINT", 0, 0, 0, true, 0, null, 0);
                DisplayDimension dim1;
                if (vertic)
                     dim1 = swModel.AddVerticalDimension2(0, 0, 0);
                else
                     dim1 = swModel.AddHorizontalDimension2(0, 0, 0);

                dim1.GetDimension().DrivenState = (int)swDimensionDrivenState_e.swDimensionDriven;
                d = dim1.GetDimension().Value;
                if (vertic)
                {
                    doubles = new double[3] { 1, 0, 0 };
                }
                else
                {
                    doubles = new double[3] {0, 1, 0};
                }
                annotation = dim1.GetAnnotation();
            }
            else
            {

                if (vertic)
                {
                    vertexS = GetVertexFromBlock(swModel, drView, vScaleRat, false);
                    if (!(vertexS != null && SelectVertexDatum(swModel, vertexS)))
                        SelectVertexDatumDown(swModel, boundBox, side);
                    else if (vertex != null)
                        blockSize = vertex.X < vertexS.X;

                    DisplayDimension dim = null;

                    dim = swModel.IAddVerticalDimension2(0, 0, 0);

                    if (dim != null)
                    {
                        d = dim.IGetDimension().Value;
                        doubles = (double[]) dim.IGetDimension().DimensionLineDirection.ArrayData;
                        if (blockSize != null)
                        {
                            vertexS.Y = vertexS.Y + (d/1000)/vScaleRat;
                        }

                        annotation = dim.IGetAnnotation();
                    }
                }
                else
                {
                    vertexS = GetVertexFromBlock(swModel, drView, vScaleRat, false);
                    if (!(vertexS != null && SelectVertexDatum(swModel, vertexS)))
                    {
                        vertexS = SelectVertexDatumUp(swModel, boundBox, side.Not());
                    }
                    else if (vertex != null)
                        blockSize = vertex.X < vertexS.X;

                    var dim = swModel.AddHorizontalDimension2(0, 0, 0);

                    if (dim != null)
                    {
                        d = dim.GetDimension().Value;
                        doubles = (double[]) dim.GetDimension().DimensionLineDirection.ArrayData;
                        annotation = dim.GetAnnotation();

                    }
                }
            }
            swModel.ClearSelection();
            return doubles;
        }
开发者ID:digger1985,项目名称:MyCode,代码行数:92,代码来源:DimensionDraft.cs


注:本文中的ModelDoc2.IAddVerticalDimension2方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。