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


C# Element.IsHidden方法代码示例

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


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

示例1: IsElementHiddenInView


//.........这里部分代码省略.........
        /// - e is specifically hidden in the view, by element
        /// - the category of e or one of its parent 
        /// categories is hidden in v.
        /// </summary>
        bool IsElementHiddenInView(
            Element e,
            View v)
        {
            if( v.CropBoxActive )
              {
            BoundingBoxXYZ viewBox = v.CropBox;
            BoundingBoxXYZ elBox = e.get_BoundingBox( v );

            Transform transInv = v.CropBox.Transform.Inverse;

            elBox.Max = transInv.OfPoint( elBox.Max );
            elBox.Min = transInv.OfPoint( elBox.Min );

            // The transform above might switch
            // max and min values.

            if( elBox.Min.X > elBox.Max.X )
            {
              XYZ tmpP = elBox.Min;
              elBox.Min = new XYZ( elBox.Max.X, elBox.Min.Y, 0 );
              elBox.Max = new XYZ( tmpP.X, elBox.Max.Y, 0 );
            }

            if( elBox.Min.Y > elBox.Max.Y )
            {
              XYZ tmpP = elBox.Min;
              elBox.Min = new XYZ( elBox.Min.X, elBox.Max.Y, 0 );
              elBox.Max = new XYZ( tmpP.X, elBox.Min.Y, 0 );
            }

            if( elBox.Min.X > viewBox.Max.X
              || elBox.Max.X < viewBox.Min.X
              || elBox.Min.Y > viewBox.Max.Y
              || elBox.Max.Y < viewBox.Min.Y )
            {
              return true;
            }
            else
            {
              BoundingBoxXYZ inside = new BoundingBoxXYZ();

              double x, y;

              x = elBox.Max.X;

              if( elBox.Max.X > viewBox.Max.X )
            x = viewBox.Max.X;

              y = elBox.Max.Y;

              if( elBox.Max.Y > viewBox.Max.Y )
            y = viewBox.Max.Y;

              inside.Max = new XYZ( x, y, 0 );

              x = elBox.Min.X;

              if( elBox.Min.X < viewBox.Min.X )
            x = viewBox.Min.X;

              y = elBox.Min.Y;

              if( elBox.Min.Y < viewBox.Min.Y )
            y = viewBox.Min.Y;

              inside.Min = new XYZ( x, y, 0 );

              double eBBArea = ( elBox.Max.X - elBox.Min.X )
            * ( elBox.Max.Y - elBox.Min.Y );

              double einsideArea =
            ( inside.Max.X - inside.Min.X )
            * ( inside.Max.Y - inside.Min.Y );

              double factor = einsideArea / eBBArea;

              if( factor < 0.25 )
            return true;
            }
              }

              bool hidden = e.IsHidden( v );

              if( !hidden )
              {
            Category cat = e.Category;

            while( null != cat && !hidden )
            {
              hidden = !cat.get_Visible( v );
              cat = cat.Parent;
            }
              }
              return hidden;
        }
开发者ID:nbright,项目名称:the_building_coder_samples,代码行数:101,代码来源:CmdCollectorPerformance.cs

示例2: IsElementVisible

        /// <summary>
        /// Checks if element is visible for certain view.
        /// </summary>
        /// <param name="element">The element.</param>
        /// <returns>True if the element is visible, false otherwise.</returns>
        public static bool IsElementVisible(Element element)
        {
            View filterView = ExporterCacheManager.ExportOptionsCache.FilterViewForExport;
            if (filterView == null)
                return true;

            bool hidden = element.IsHidden(filterView);
            if (hidden)
                return false;

            Category category = element.Category;
            hidden = !IsCategoryVisible(category, filterView);
            if (hidden)
                return false;

            bool temporaryVisible = filterView.IsElementVisibleInTemporaryViewMode(TemporaryViewMode.TemporaryHideIsolate, element.Id);

            return temporaryVisible;
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:24,代码来源:ElementFilteringUtil.cs

示例3: IsElementVisible

        /// <summary>
        /// Checks if element is visible for certain view.
        /// </summary>
        /// <param name="filterView">The view.</param>
        /// <param name="element">The element.</param>
        /// <returns>True if the element is visible, false otherwise.</returns>
        public static bool IsElementVisible(View filterView, Element element)
        {
            bool hidden = element.IsHidden(filterView);
            if (hidden)
                return false;

            Category category = element.Category;
            hidden = CheckIsCategoryHidden(filterView, element);
            if (hidden)
                return false;

            bool temporaryVisible = filterView.IsElementVisibleInTemporaryViewMode(TemporaryViewMode.TemporaryHideIsolate, element.Id);

            return temporaryVisible;
        }
开发者ID:whztt07,项目名称:BIM-IFC,代码行数:21,代码来源:ElementFilteringUtil.cs

示例4: IsElementVisible

        /// <summary>
        /// Checks if element is visible for certain view.
        /// </summary>
        /// <param name="filterView">The view.</param>
        /// <param name="element">The element.</param>
        /// <returns>True if the element is visible, false otherwise.</returns>
        public static bool IsElementVisible(View filterView, Element element)
        {
            Document doc = element.Document;
            bool hidden = element.IsHidden(filterView);
            if (hidden)
                return false;

            Category category = element.Category;
            if (category != null && category.get_AllowsVisibilityControl(filterView) && !category.get_Visible(filterView))
                return false;

            bool temporaryVisible = filterView.IsElementVisibleInTemporaryViewMode(TemporaryViewMode.TemporaryHideIsolate, element.Id);

            return temporaryVisible;
        }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:21,代码来源:ElementFilteringUtil.cs


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