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


C# ExporterIFC.RegisterWallConnectionData方法代码示例

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


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

示例1: Export

        /// <summary>
        /// Exports Walls.
        /// </summary>
        /// <param name="exporterIFC">
        /// The ExporterIFC object.
        /// </param>
        /// <param name="wallElement">
        /// The wall element.
        /// </param>
        /// <param name="geometryElement">
        /// The geometry element.
        /// </param>
        /// <param name="productWrapper">
        /// The IFCProductWrapper.
        /// </param>
        public static void Export(ExporterIFC exporterIFC, Wall wallElement, GeometryElement geometryElement, IFCProductWrapper productWrapper)
        {
            IFCFile file = exporterIFC.GetFile();
            using (IFCTransaction tr = new IFCTransaction(file))
            {
                bool exportAsOldCurtainWall = ExporterIFCUtils.IsLegacyCurtainWall(wallElement);
                bool exportAsCurtainWall = (wallElement.CurtainGrid != null);

                try
                {
                    if (exportAsOldCurtainWall)
                        ExporterIFCUtils.ExportLegacyCurtainWall(exporterIFC, wallElement, geometryElement, productWrapper);
                    else if (exportAsCurtainWall)
                        ExporterIFCUtils.ExportCurtainWall(exporterIFC, wallElement, geometryElement, productWrapper);
                    else
                        ExportWall(exporterIFC, wallElement, geometryElement, productWrapper);
                }
                catch (System.Exception ex)
                {
                    throw ex;
                }

                // create join information.
                ElementId id = wallElement.Id;

                IList<IList<IFCConnectedWallData>> connectedWalls = new List<IList<IFCConnectedWallData>>();
                connectedWalls.Add(ExporterIFCUtils.GetConnectedWalls(wallElement, IFCConnectedWallDataLocation.Start));
                connectedWalls.Add(ExporterIFCUtils.GetConnectedWalls(wallElement, IFCConnectedWallDataLocation.End));
                for (int ii = 0; ii < 2; ii++)
                {
                    int count = connectedWalls[ii].Count;
                    IFCConnectedWallDataLocation currConnection = (ii == 0) ? IFCConnectedWallDataLocation.Start : IFCConnectedWallDataLocation.End;
                    for (int jj = 0; jj < count; jj++)
                    {
                        ElementId otherId = connectedWalls[ii][jj].ElementId;
                        IFCConnectedWallDataLocation joinedEnd = connectedWalls[ii][jj].Location;

                        if ((otherId == id) && (joinedEnd == currConnection))  //self-reference
                            continue;

                        exporterIFC.RegisterWallConnectionData(id, otherId, currConnection, joinedEnd, IFCAnyHandle.Create());
                    }
                }

                // look for connected columns.  Note that this is only for columns that interrupt the wall path.
                IList<FamilyInstance> attachedColumns = ExporterIFCUtils.GetAttachedColumns(wallElement);
                int numAttachedColumns = attachedColumns.Count;
                for (int ii = 0; ii < numAttachedColumns; ii++)
                {
                    ElementId otherId = attachedColumns[ii].Id;

                    IFCConnectedWallDataLocation connect1 = IFCConnectedWallDataLocation.NotDefined;   // can't determine at the moment.
                    IFCConnectedWallDataLocation connect2 = IFCConnectedWallDataLocation.NotDefined;   // meaningless for column

                    exporterIFC.RegisterWallConnectionData(id, otherId, connect1, connect2, IFCAnyHandle.Create());
                }

                tr.Commit();
            }
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:75,代码来源:WallExporter.cs


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