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


C# Document.Regenerate方法代码示例

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


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

示例1: UpdateDoorsGeometry

        /// <summary>
        /// Doors related rooms: update doors' geometry according to its To/From room information.
        /// </summary>
        /// <param name="creFilter">One element filter utility object.</param>
        /// <param name="doc">Revit project.</param>
        /// <param name="onlyUpdateSelect">
        /// true means only update selected doors' information else false.
        /// </param>
        public static void UpdateDoorsGeometry(Document doc, bool onlyUpdateSelect)
        {
            IEnumerator iter;
             int doorCount = 0;

             if (onlyUpdateSelect) // update doors in select elements
             {
            UIDocument newUIdoc = new UIDocument(doc);
            iter = newUIdoc.Selection.Elements.GetEnumerator();
             }
             else // update all doors in current Revit document
             {
             ElementClassFilter familyInstanceFilter = new ElementClassFilter(typeof(FamilyInstance));
             ElementCategoryFilter doorsCategoryfilter = new ElementCategoryFilter(BuiltInCategory.OST_Doors);
             LogicalAndFilter doorInstancesFilter = new LogicalAndFilter(familyInstanceFilter, doorsCategoryfilter);
             iter = new FilteredElementCollector(doc).WherePasses(doorInstancesFilter).GetElementIterator();
             }

             iter.Reset();
             while (iter.MoveNext())
             {
            // find door instance
            FamilyInstance door = iter.Current as FamilyInstance;

            if (onlyUpdateSelect)
            {
               if (null == door)
               {
                  continue;
               }

               if (null == door.Category)
               {
                  continue;
               }

               if (!door.Category.Name.Equals("Doors"))
               {
                  continue;
               }
            }

            // find one door.
            doorCount++;

            // update one door.
            UpdateFromToRoomofOneDoor(door, true);
            doc.Regenerate();
             }

             if (onlyUpdateSelect)
             {
            System.Windows.Forms.MessageBox.Show("Updated all selected doors (" + doorCount +
                                                 " doors).\r\n (Selection may include miscellaneous elements.)",
                                                 "Door Swing");
             }
             else
             {
            System.Windows.Forms.MessageBox.Show("Updated all doors of this project (" +
                                                 doorCount + " doors).", "Door Swing");
             }
        }
开发者ID:AMEE,项目名称:revit,代码行数:70,代码来源:DoorSwingData.cs


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