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


C# Autodesk.IsHidden方法代码示例

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


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

示例1: SendElement

        /// <summary>
        /// Draw geometry of element.
        /// </summary>
        /// <param name="elementGeom"></param>
        /// <remarks></remarks>
        private void SendElement(Autodesk.Revit.DB.GeometryElement elementGeom, Autodesk.Revit.DB.Element elem)
        {
            if (elementGeom == null)
             {
            return;
             }
             try
             {
            if (elem.IsHidden(View3D))
            {
               return;
            }
            if (!elem.Category.get_Visible(View3D as Autodesk.Revit.DB.View))
            {
               return;
            }
             }
             catch
             {
             }
             int num = 0;
             IEnumerator<Autodesk.Revit.DB.GeometryObject> Objects = elementGeom.GetEnumerator();
             while (Objects.MoveNext())
             {
             Autodesk.Revit.DB.GeometryObject geomObject = Objects.Current;
            if (geomObject.Visibility == Autodesk.Revit.DB.Visibility.Visible)
            {
               if ((geomObject is Autodesk.Revit.DB.Curve))
               {
                  //mb.add((int)ObjectTypes.Curve);
                  //SendCurve(geomObject);
               }
               else if ((elem is Autodesk.Revit.DB.SpatialElement))
               {
                   // don't show room volumes
               }
               else if ((geomObject is Autodesk.Revit.DB.GeometryInstance))
               {
                   /*if (elem.Category.Name != "{3}")
                   {
                      if (!elem.Category.get_Visible(View3D as Autodesk.Revit.DB.View))
                      {
                         return;
                      }
                   }*/

                   SendInstance(geomObject as Autodesk.Revit.DB.GeometryInstance, elem);
               }
               else if ((geomObject is Autodesk.Revit.DB.Mesh))
               {
                   MessageBuffer mb = new MessageBuffer();
                   mb.add(elem.Id.IntegerValue);
                   mb.add(elem.Name + "_m_" + num.ToString());
                   mb.add((int)ObjectTypes.Mesh);
                   Autodesk.Revit.DB.Mesh meshObj = geomObject as Autodesk.Revit.DB.Mesh;
                   SendMesh(meshObj, ref mb, true);// TODO get information on whether a mesh is twosided or not

                   Autodesk.Revit.DB.ElementId materialID;
                   materialID = meshObj.MaterialElementId;
                   Autodesk.Revit.DB.Material materialElement = elem.Document.GetElement(materialID) as Autodesk.Revit.DB.Material;
                   if (materialElement != null)
                   {
                       mb.add(materialElement.Color);
                       mb.add((byte)(((100 - (materialElement.Transparency)) / 100.0) * 255));
                       mb.add(materialID.IntegerValue); // material ID
                   }
                   else
                   {
                       mb.add((byte)250); // color
                       mb.add((byte)250);
                       mb.add((byte)250);
                       mb.add((byte)255);
                       mb.add(-1); // material ID
                   }
                   sendMessage(mb.buf, MessageTypes.NewObject);
                   if (num == 0)
                   sendParameters(elem);
               }
               else if ((geomObject is Autodesk.Revit.DB.Solid))
               {
                   MessageBuffer mb = new MessageBuffer();
                   mb.add(elem.Id.IntegerValue);
                   mb.add(elem.Name + "_s_" + num.ToString());
                   sendMessage(mb.buf, MessageTypes.NewGroup);
                   SendSolid((Autodesk.Revit.DB.Solid)geomObject, elem);
                   mb = new MessageBuffer();
                   sendMessage(mb.buf, MessageTypes.EndGroup);
                   if(num == 0)
                    sendParameters(elem);
               }
               num++;
            }
             }
        }
开发者ID:dwickeroth,项目名称:covise,代码行数:99,代码来源:COVER.cs

示例2: IsHiddenElementOrCategory

        static bool IsHiddenElementOrCategory(Autodesk.Revit.DB.Element e, View3D v)
        {
            try
            {
                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;
            }
            catch (Exception ex)
            {
                return true;
               // MessageBox.Show("Test"+ex.Message.ToString());
               // throw;
            }
        }
开发者ID:jchristel,项目名称:LuxExporter,代码行数:24,代码来源:LuxExporter_Main.cs


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