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


C# IFCFile.CreateInstance方法代码示例

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


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

示例1: CreateSweptDiskSolid

      /// <summary>
      /// Creates a handle representing an IfcSweptDiskSolid and assigns it to the file.
      /// </summary>
      /// <param name="file">The file.</param>
      /// <param name="directrix">The curve used to define the sweeping operation.</param>
      /// <param name="radius">The radius of the circular disk to be swept along the directrix.</param>
      /// <param name="innerRadius">This attribute is optional, if present it defines the radius of a circular hole in the centre of the disk.</param>
      /// <param name="startParam">The parameter value on the directrix at which the sweeping operation commences.</param>
      /// <param name="endParam">The parameter value on the directrix at which the sweeping operation ends.</param>
      /// <returns>The handle.</returns>
      public static IFCAnyHandle CreateSweptDiskSolid(IFCFile file, IFCAnyHandle directrix, double radius,
          double? innerRadius, double startParam, double endParam)
      {
         IFCAnyHandleUtil.ValidateSubTypeOf(directrix, false, IFCEntityType.IfcCurve);

         IFCAnyHandle sweptDiskSolid = file.CreateInstance(IFCEntityType.IfcSweptDiskSolid.ToString());
         IFCAnyHandleUtil.SetAttribute(sweptDiskSolid, "Directrix", directrix);
         IFCAnyHandleUtil.SetAttribute(sweptDiskSolid, "Radius", radius);
         IFCAnyHandleUtil.SetAttribute(sweptDiskSolid, "InnerRadius", innerRadius);
         IFCAnyHandleUtil.SetAttribute(sweptDiskSolid, "StartParam", startParam);
         IFCAnyHandleUtil.SetAttribute(sweptDiskSolid, "EndParam", endParam);
         return sweptDiskSolid;
      }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:23,代码来源:IFCInstanceExporter.cs

示例2: CreateInstance

        /////////////////////////////////////////////////////////////////
        // SetXXX method is to set base entities' attributes.
        // Every SetXXX method has a corresponding ValidateXXX method.
        // ValidateXXX is to validate the parameters for the attributes.
        // ValidateXXX should not be called in SetXXX. It must be called in CreateXXX method.
        // This is to make sure all arguments are valid BEFORE create an instance.
        // So we have below layout for these methods:
        //   ValidateABCBaseEntity(...) { ... }
        //   SetABCBaseEntity(...) { ... }
        //   CreateABCEntity(...)
        //      {
        //         //Code to validate ABC entity's own parameters goes here.
        //         ValidateABCBaseEntity(...);
        //         //Code to create ABC instance goes here.
        //         //Code to set ABC entity's own attributes goes here.
        //         SetABCBaseEntity(...);
        //      }
        ///////////////////////////////////////////////////////////////

        private static IFCAnyHandle CreateInstance(IFCFile file, IFCEntityType type)
        {
            IFCAnyHandle hnd = file.CreateInstance(type.ToString());
            ExporterCacheManager.HandleTypeCache[hnd] = type;
            return hnd;
        }
开发者ID:whztt07,项目名称:BIM-IFC,代码行数:25,代码来源:IFCInstanceExporter.cs


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