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


C# ExporterIFC.GetNameFromExportState方法代码示例

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


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

示例1: CreateIFCName

        /// <summary>
        /// Creates an IFC name from export state.
        /// </summary>
        /// <param name="exporterIFC">
        /// The ExporterIFC object.
        /// </param>
        /// <param name="index">
        /// The index of the name. If it is larger than 0, it is appended to the name.
        /// </param>
        /// <returns>
        /// The IFCLabel contains the name string value.
        /// </returns>
        public static IFCLabel CreateIFCName(ExporterIFC exporterIFC, int index)
        {
            IFCLabel origName = exporterIFC.GetNameFromExportState();
            string elemName = origName.String;
            if (index >= 0)
            {
                elemName += ":";
                elemName += index.ToString();
            }

            return IFCLabel.Create(elemName);
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:24,代码来源:NamingUtil.cs

示例2: ExportBase

        /// <summary>
        /// Export Curtain Walls and Roofs.
        /// </summary>
        /// <param name="exporterIFC">
        /// The ExporterIFC object.
        /// </param>
        /// <param name="allSubElements">
        /// Collection of elements contained in the host curtain element.
        /// </param>
        /// <param name="hostElement">
        /// The host element to be exported.
        /// </param>
        /// <param name="productWrapper">
        /// The IFCProductWrapper.
        /// </param>
        public static void ExportBase(ExporterIFC exporterIFC, ElementSet allSubElements,
           HostObject hostElement, IFCProductWrapper wrapper)
        {
            IFCFile file = exporterIFC.GetFile();
            IFCAnyHandle ownerHistory = exporterIFC.GetOwnerHistoryHandle();

            IFCPlacementSetter setter = null;
            IFCProductWrapper curtainWallSubWrapper = null;
            try
            {
                IFCAnyHandle localPlacement = IFCAnyHandle.Create();
                bool canExportCurtainWallAsContainer = CanExportCurtainWallAsContainer(allSubElements);
                IFCAnyHandle rep = IFCAnyHandle.Create();
                if (canExportCurtainWallAsContainer)
                {
                    curtainWallSubWrapper = IFCProductWrapper.Create(exporterIFC, true);
                    setter = IFCPlacementSetter.Create(exporterIFC, hostElement);
                    localPlacement = setter.GetPlacement();
                    rep = ExportCurtainObjectCommonAsOneBRep(allSubElements, hostElement, exporterIFC, setter, localPlacement);
                }
                else
                {
                    ExportCurtainObjectCommonAsContainer(allSubElements, hostElement, exporterIFC, out curtainWallSubWrapper);
                    // This has to go LAST.  Why?  Because otherwise we apply the level transform twice -- once in the familyTrf, once here.
                    // This will be used just to put the CurtainWall on the right level.
                    setter = IFCPlacementSetter.Create(exporterIFC, hostElement);
                    localPlacement = setter.GetPlacement();
                }

                if (!rep.HasValue)
                    return;

                IFCLabel objectType = NamingUtil.CreateIFCObjectName(exporterIFC, hostElement);

                IFCExtrusionCreationData extraParams = new IFCExtrusionCreationData();
                extraParams.SetLocalPlacement(localPlacement);

                IFCAnyHandle prodRepHnd = IFCAnyHandle.Create();
                IFCAnyHandle elemHnd = IFCAnyHandle.Create();
                IFCLabel elemGUID = IFCLabel.CreateGUID(hostElement);
                IFCLabel elemName = NamingUtil.GetNameOverride(hostElement, exporterIFC.GetNameFromExportState());
                IFCLabel elemDesc = NamingUtil.GetDescriptionOverride(hostElement, IFCLabel.Create());
                IFCLabel elemType = NamingUtil.GetObjectTypeOverride(hostElement, objectType);
                IFCLabel elemId = NamingUtil.CreateIFCElementId(hostElement);
                if (hostElement is Wall || hostElement is CurtainSystem)
                {
                    elemHnd = file.CreateCurtainWall(elemGUID, ownerHistory, elemName, elemDesc, elemType, localPlacement, elemId, prodRepHnd);
                }
                else if (hostElement is RoofBase)
                {
                    string ifcEnumType = CategoryUtil.GetIFCEnumTypeName(exporterIFC, hostElement);
                    elemHnd = file.CreateRoof(elemGUID, ownerHistory, elemName, elemDesc, elemType, localPlacement, elemId, ifcEnumType, prodRepHnd);
                }
                else
                {
                    return;
                }

                if (!elemHnd.HasValue)
                    return;

                wrapper.AddElement(elemHnd, setter, extraParams, true);
                OpeningUtil.CreateOpeningsIfNecessary(elemHnd, hostElement, extraParams, exporterIFC, localPlacement, setter, wrapper);

                ExporterIFCUtils.CreateCurtainWallPropertySet(exporterIFC, hostElement, wrapper);
                ICollection<IFCAnyHandle> relatedElementIds = curtainWallSubWrapper.GetAllObjects();
                if (relatedElementIds.Count > 0)
                {
                    IFCLabel guid = IFCLabel.CreateGUID();
                    IFCLabel nameOpt = IFCLabel.Create();
                    IFCLabel descOpt = IFCLabel.Create();
                    file.CreateRelAggregates(guid, ownerHistory, nameOpt, descOpt, elemHnd, relatedElementIds);
                }
                exporterIFC.RegisterSpaceBoundingElementHandle(elemHnd, hostElement.Id, ElementId.InvalidElementId);
            }
            finally
            {
                if (setter != null)
                    setter.Dispose();
                if (curtainWallSubWrapper != null)
                    curtainWallSubWrapper.Dispose();
            }
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:98,代码来源:CurtainSystemExporter.cs


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