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


C# Autodesk.Equals方法代码示例

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


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

示例1: CreateLine

        /// <summary>
        /// Create the line(ModelLine)
        /// </summary>
        /// <param name="sketchId">the id of the sketch plane</param>
        /// <param name="startPoint">the start point of the line</param>
        /// <param name="endPoint">the end point of the line</param>
        public void CreateLine(int sketchId, Autodesk.Revit.DB.XYZ startPoint, Autodesk.Revit.DB.XYZ endPoint)
        {
            try
            {
                // First get the sketch plane by the giving element id.
                SketchPlane workPlane = GetSketchPlaneById(sketchId);

                // Additional check: start point should not equal end point
                if (startPoint.Equals(endPoint))
                {
                    throw new ArgumentException("Two points should not be the same.");
                }

                // create geometry line
                Line geometryLine = m_createApp.NewLine(startPoint, endPoint, true);
                if (null == geometryLine)       // assert the creation is successful
                {
                    throw new Exception("Create the geometry line failed.");
                }
                // create the ModelLine
                ModelLine line = m_createDoc.NewModelCurve(geometryLine, workPlane) as ModelLine;
                if (null == line)               // assert the creation is successful
                {
                    throw new Exception("Create the ModelLine failed.");
                }
                // Add the created ModelLine into the line array
                m_lineArray.Append(line);

                // Finally refresh information map.
                RefreshInformationMap();
            }
            catch (Exception ex)
            {
                throw new Exception("Can not create the ModelLine, message: " + ex.Message);
            }
        }
开发者ID:AMEE,项目名称:revit,代码行数:42,代码来源:ModelLines.cs

示例2: CreateArc

        /// <summary>
        /// Create the arc(ModelArc)
        /// </summary>
        /// <param name="sketchId">the id of the sketch plane</param>
        /// <param name="startPoint">the start point of the arc</param>
        /// <param name="endPoint">the end point of the arc</param>
        /// <param name="thirdPoint">the third point which is on the arc</param>
        public void CreateArc(int sketchId, Autodesk.Revit.DB.XYZ startPoint, Autodesk.Revit.DB.XYZ endPoint, Autodesk.Revit.DB.XYZ thirdPoint)
        {
            try
            {
                // First get the sketch plane by the giving element id.
                SketchPlane workPlane = GetSketchPlaneById(sketchId);

                // Additional check: the start, end and third point should not be the same
                if (startPoint.Equals(endPoint) || startPoint.Equals(thirdPoint)
                    || endPoint.Equals(thirdPoint))
                {
                    throw new ArgumentException("Three points should not be the same.");
                }

                // create the geometry arc
                Arc geometryArc = m_createApp.NewArc(startPoint, endPoint, thirdPoint);
                if (null == geometryArc)            // assert the creation is successful
                {
                    throw new Exception("Create the geometry arc failed.");
                }
                // create the ModelArc
                ModelArc arc = m_createDoc.NewModelCurve(geometryArc, workPlane) as ModelArc;
                if (null == arc)                    // assert the creation is successful
                {
                    throw new Exception("Create the ModelArc failed.");
                }
                // Add the created ModelArc into the arc array
                m_arcArray.Append(arc);

                // Finally refresh information map.
                RefreshInformationMap();
            }
            catch (Exception ex)
            {
                throw new Exception("Can not create the ModelArc, message: " + ex.Message);
            }
        }
开发者ID:AMEE,项目名称:revit,代码行数:44,代码来源:ModelLines.cs


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