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


C# Autodesk.PointAtParameter方法代码示例

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


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

示例1: ColumnByCurve

        /// <summary>
        /// Create a column.
        /// </summary>
        /// <param name="curve">The curve which defines the center line of the column.</param>
        /// <param name="level">The level with which you'd like the column to be associated.</param>
        /// <param name="structuralColumnType">The structural column type representing the column.</param>
        /// <returns></returns>
        public static StructuralFraming ColumnByCurve(
            Autodesk.DesignScript.Geometry.Curve curve, Revit.Elements.Level level, Revit.Elements.FamilySymbol structuralColumnType)
        {
            if (curve == null)
            {
                throw new System.ArgumentNullException("curve");
            }

            if (level == null)
            {
                throw new System.ArgumentNullException("level");
            }

            if (structuralColumnType == null)
            {
                throw new System.ArgumentNullException("structuralColumnType");
            }

            var start = curve.PointAtParameter(0);
            var end = curve.PointAtParameter(1);

            // Revit will throw an exception if you attempt to create a column whose 
            // base is above its top. 
            if (end.Z <= start.Z)
            {
                throw new Exception("The end of the curve for creating a column should be above the start of the curve.");
            }

            return new StructuralFraming(curve.ToRevitType(), level.InternalLevel, Autodesk.Revit.DB.Structure.StructuralType.Column, structuralColumnType.InternalFamilySymbol);
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:37,代码来源:StucturalFraming.cs

示例2: Convert

      /// <summary>
      /// Convert a generic Circle to a Revit Curve
      /// </summary>
      /// <param name="crvCurve"></param>
      /// <returns></returns>
      private static Autodesk.Revit.DB.Curve Convert(Autodesk.DesignScript.Geometry.Curve crvCurve)
      {
         Autodesk.DesignScript.Geometry.Curve[] curves = crvCurve.ApproximateWithArcAndLineSegments();
         if (curves.Length == 1)
         {
            //line or arc?
            var point0 = crvCurve.PointAtParameter(0.0);
            var point1 = crvCurve.PointAtParameter(1.0);
            var pointMid = crvCurve.PointAtParameter(0.5);
            if (point0.DistanceTo(point1) > 1e-7)
            {
               var line = Autodesk.DesignScript.Geometry.Line.ByStartPointEndPoint(point0, point1);
               if (pointMid.DistanceTo(line) < 1e-7)
                  return Convert(line);
            }
            //then arc
            if (point0.DistanceTo(point1) < 1e-7)
               point1 = crvCurve.PointAtParameter(0.9);
            var arc = Autodesk.DesignScript.Geometry.Arc.ByThreePoints(point0, pointMid, point1);
            return Convert(arc);
         }
 
         return Convert(crvCurve.ToNurbsCurve());
      }
开发者ID:algobasket,项目名称:Dynamo,代码行数:29,代码来源:ProtoToRevitCurve.cs

示例3: Convert

        private static Autodesk.Revit.DB.Arc Convert(Autodesk.DesignScript.Geometry.Circle circ)
        {
            // convert
            var center = circ.CenterPoint.ToXyz(false);
            var sp = circ.StartPoint.ToXyz(false);

            // get the xaxis of the arc base plane normalized
            var x = (sp - center).Normalize();

            // get a second vector in the plane
            var vecY = (circ.PointAtParameter(0.1).ToXyz(false) - center);

            // get the normal to the plane
            var n2 = x.CrossProduct(vecY).Normalize();

            // obtain the y axis in the plane - perp to x and z
            var y = n2.CrossProduct(x);

            var plane = new Autodesk.Revit.DB.Plane(x, y, center);
            return Autodesk.Revit.DB.Arc.Create(plane, circ.Radius, 0, 2 * System.Math.PI);
        }
开发者ID:heegwon,项目名称:Dynamo,代码行数:21,代码来源:ProtoToRevitCurve.cs


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