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


C# IFCFile.CreateCartesianPoint方法代码示例

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


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

示例1: CreateDefaultMappedItem

 /// <summary>
 /// Creates IfcMappedItem object.
 /// </summary>
 /// <param name="file">
 /// The IFC file.
 /// </param>
 /// <param name="repMap">
 /// The handle to be mapped.
 /// </param>
 /// <param name="orig">
 /// The orig for mapping transformation.
 /// </param>
 /// <returns>
 /// The handle.
 /// </returns>
 public static IFCAnyHandle CreateDefaultMappedItem(IFCFile file, IFCAnyHandle repMap, XYZ orig)
 {
     IFCAnyHandle origin = file.CreateCartesianPoint(orig);
     IFCMeasureValue scale = IFCMeasureValue.Create(1.0);
     IFCAnyHandle mappingTarget =
        file.CreateCartesianTransformationOperator3D(IFCAnyHandle.Create(), IFCAnyHandle.Create(), origin, scale, IFCAnyHandle.Create());
     return file.CreateMappedItem(repMap, mappingTarget);
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:23,代码来源:ExporterUtil.cs

示例2: CreateCartesianPoint

        /// <summary>
        /// Creates IfcCartesianPoint object.
        /// </summary>
        /// <param name="file">
        /// The IFC file.
        /// </param>
        /// <param name="measure">
        /// The list of doubles to create the Cartesian point.
        /// </param>
        /// <returns>
        /// The handle.
        /// </returns>
        public static IFCAnyHandle CreateCartesianPoint(IFCFile file, IList<double> measure)
        {
            IList<double> cleanMeasure = new List<double>();
            foreach (double value in measure)
            {
                double ceilMeasure = Math.Ceiling(value);
                double floorMeasure = Math.Floor(value);

                if (MathUtil.IsAlmostEqual(value, ceilMeasure))
                    cleanMeasure.Add(ceilMeasure);
                else if (MathUtil.IsAlmostEqual(value, floorMeasure))
                    cleanMeasure.Add(floorMeasure);
                else
                    cleanMeasure.Add(value);
            }

            if (MathUtil.IsAlmostZero(cleanMeasure[0]) && MathUtil.IsAlmostZero(cleanMeasure[1]))
            {
                if (measure.Count == 2)
                {
                    return ExporterIFCUtils.GetGlobal2DOriginHandle();
                }
                if (measure.Count == 3 && MathUtil.IsAlmostZero(cleanMeasure[2]))
                {
                    return ExporterIFCUtils.GetGlobal3DOriginHandle();
                }

            }

            IFCAnyHandle pointHandle = file.CreateCartesianPoint(cleanMeasure);

            return pointHandle;
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:45,代码来源:ExporterUtil.cs


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