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


C# Autodesk.Select方法代码示例

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


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

示例1: Robustify

        /// <summary>
        /// This method contains workarounds for increasing the robustness of input geometry
        /// </summary>
        /// <param name="geometry"></param>
        /// <param name="translation"></param>
        private static void Robustify(ref Autodesk.DesignScript.Geometry.Geometry[] geometry,
            ref Autodesk.DesignScript.Geometry.Vector translation)
        {
            // translate all geom to centroid of bbox, then translate back
            var bb = Autodesk.DesignScript.Geometry.BoundingBox.ByGeometry(geometry);

            // get center of bbox
            var trans = ((bb.MinPoint.ToXyz() + bb.MaxPoint.ToXyz())/2).ToVector().Reverse();

            // translate all geom so that it is centered by bb
            geometry = geometry.Select(x => x.Translate(trans)).ToArray();

            // so that we can move it all back
            translation = trans.Reverse();
        }
开发者ID:algobasket,项目名称:Dynamo,代码行数:20,代码来源:ImportInstance.cs

示例2: ByCurvesAndDivisions

        public static DividedPath ByCurvesAndDivisions(Autodesk.DesignScript.Geometry.Curve[] curve, int divisions)
        {
            if (curve == null)
            {
                throw new ArgumentNullException("curve");
            }

            if (divisions < 2)
            {
                throw new Exception("The number of divisions must be greater than 2!");
            }

            if (curve.Any(x => x == null))
            {
                throw new ArgumentNullException(String.Format("curves[{0}]", Array.FindIndex(curve, x => x == null)));
            }

            return new DividedPath(curve.Select(x => ElementCurveReference.TryGetCurveReference(x)).ToArray(), divisions);
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:19,代码来源:DividedPath.cs

示例3: ByParametersOnFace

        /// <summary>
        /// Create an adaptive component by uv points on a face.
        /// </summary>
        /// <param name="uvs">An array of UV pairs</param>
        /// <param name="surface">The surface on which to place the AdaptiveComponent</param>
        /// <param name="familySymbol"></param>
        /// <returns></returns>
        public static AdaptiveComponent ByParametersOnFace( Autodesk.DesignScript.Geometry.UV[] uvs, Surface surface, FamilySymbol familySymbol)
        {
            if (uvs == null)
            {
                throw new ArgumentNullException("uvs");
            }

            if (surface == null)
            {
                throw new ArgumentNullException("surface");
            }

            if (familySymbol == null)
            {
                throw new ArgumentNullException("familySymbol");
            }

            return new AdaptiveComponent(uvs.Select(x => new []{x.U,x.V}).ToArray(), ElementFaceReference.TryGetFaceReference(surface), familySymbol);
        }
开发者ID:whztt07,项目名称:Dynamo,代码行数:26,代码来源:AdaptiveComponent.cs

示例4: ByGeometries

        /// <summary>
        /// Import a collection of Geometry (Solid, Curve, Surface, etc) into Revit as an ImportInstance.  This variant is much faster than
        /// ImportInstance.ByGeometry as it uses a batch method.
        /// </summary>
        /// <param name="geometries">A collection of Geometry</param>
        /// <returns></returns>
        public static ImportInstance ByGeometries(Autodesk.DesignScript.Geometry.Geometry[] geometries)
        {
            if (geometries == null)
            {
                throw new ArgumentNullException("geometries");
            }

            // transform geometry from dynamo unit system (m) to revit (ft)
            geometries = geometries.Select(x => x.InHostUnits()).ToArray();

            var translation = Vector.ByCoordinates(0, 0, 0);
            Robustify(ref geometries, ref translation);

            // Export to temporary file
            var fn = System.IO.Path.GetTempPath() + Guid.NewGuid().ToString() + ".sat";
            var exported_fn = Autodesk.DesignScript.Geometry.Geometry.ExportToSAT(geometries, fn);

            return new ImportInstance(exported_fn, translation.ToXyz());
        }
开发者ID:RobertiF,项目名称:Dynamo,代码行数:25,代码来源:ImportInstance.cs


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