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


C# Element.GetAnalyticalModel方法代码示例

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


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

示例1: GetFramingPoints

    bool GetFramingPoints( Element e, out XYZ p, out XYZ q )
    {
      p = q = null;

      bool rc = false;

      if( e is FamilyInstance
        && null != e.Category )
      {
        Category cat = e.Category;

        //int ibic = (int) cat.Id.IntegerValue;
        //if( _framing_category_ints.Contains<int>( 
        //  ibic ) ) { }

        int icat = cat.Id.IntegerValue;

        if( icat.Equals( 
          (int) BuiltInCategory.OST_StructuralFraming ) )
        {
          LocationCurve lc = e.Location as LocationCurve;

          if( null != lc )
          {
            Line line = lc.Curve as Line;

            if( null != line )
            {
              p = line.get_EndPoint( 0 );
              q = line.get_EndPoint( 1 );
              rc = true;
            }
          }
        }
        else if( icat.Equals(
          (int) BuiltInCategory.OST_StructuralColumns ) )
        {
          AnalyticalModel am = e.GetAnalyticalModel();

          if( null != am )
          {
            Line line = am.GetCurve() as Line;

            if( null != line )
            {
              p = line.get_EndPoint( 0 );
              q = line.get_EndPoint( 1 );
              rc = true;
            }
          }
        }
      }
      return rc;
    }
开发者ID:jeremytammik,项目名称:FramingXsecAnalyzer,代码行数:54,代码来源:Command.cs

示例2: Stream

        private void Stream( ArrayList data, Element elem )
        {
            data.Add( new Snoop.Data.ClassSeparator( typeof( Element ) ) );

              try
              {
            data.Add( new Snoop.Data.String( "Name", elem.Name ) );
              }
              catch( Exception ex )
              {
            data.Add( new Snoop.Data.Exception( "Name", ex ) );
              }

              data.Add( new Snoop.Data.Int( "ID", elem.Id.IntegerValue ) );
              data.Add( new Snoop.Data.String( "Unique ID", elem.UniqueId ) );
              data.Add( new Snoop.Data.Object( "Category", elem.Category ) );
              data.Add( new Snoop.Data.ElementId( "Object type", elem.GetTypeId(), elem.Document ) );
              data.Add( new Snoop.Data.Object( "Level", elem.LevelId ) );
              data.Add( new Snoop.Data.Object( "Document", elem.Document ) );
              data.Add( new Snoop.Data.Object( "Location", elem.Location ) );

              try
              {
            data.Add( new Snoop.Data.Enumerable( "Materials", elem.GetMaterialIds( false ), elem.Document ) );
              }
              catch( Exception ex )
              {
            data.Add( new Snoop.Data.Exception( "Materials", ex ) );
              }

              data.Add( new Snoop.Data.ParameterSet( "Parameters", elem, elem.Parameters ) );
              data.Add( new Snoop.Data.Enumerable( "Parameters map", elem.ParametersMap ) );
              data.Add( new Snoop.Data.Object( "Design option", elem.DesignOption ) );
              data.Add( new Snoop.Data.ElementId( "Group Id", elem.GroupId, elem.Document ) );
              data.Add( new Snoop.Data.ElementId( "Created phase", elem.CreatedPhaseId, elem.Document ) );
              data.Add( new Snoop.Data.ElementId( "Demolished phase", elem.DemolishedPhaseId, elem.Document ) );

              try
              {
            data.Add( new Snoop.Data.ElementSet( "Similar object types", elem.GetValidTypes(), elem.Document ) );
              }
              catch( Exception ex )
              {
            data.Add( new Snoop.Data.Exception( "Similar object types", ex ) );
              }

              data.Add( new Snoop.Data.Bool( "Pinned", elem.Pinned ) );
              data.Add( new Snoop.Data.ElementGeometry( "Geometry", elem, m_app.Application ) );

              data.Add( new Snoop.Data.Object( "Analytical model", elem.GetAnalyticalModel() ) );

              // Try to access the extensible storage of this element.

              foreach( Schema schema in Schema.ListSchemas() )
              {
            String objectName = "Entity with Schema [" + schema.SchemaName + "]";
            try
            {
              Entity entity = elem.GetEntity( schema );
              if( !entity.IsValid() )
            continue;
              data.Add( new Snoop.Data.Object( objectName, entity ) );
            }
            catch( System.Exception ex )
            {
              data.Add( new Snoop.Data.Exception( objectName, ex ) );
            }
              }

              // See if it is a type we are responsible for

              Area area = elem as Area;
              if( area != null )
              {
            Stream( data, area );
            return;
              }

              AreaReinforcement areaReinforcement = elem as AreaReinforcement;
              if( areaReinforcement != null )
              {
            Stream( data, areaReinforcement );
            return;
              }

              AreaReinforcementCurve areaReinforcementCurve = elem as AreaReinforcementCurve;
              if( areaReinforcementCurve != null )
              {
            Stream( data, areaReinforcementCurve );
            return;
              }

              AreaTag areaTag = elem as AreaTag;
              if( areaTag != null )
              {
            Stream( data, areaTag );
            return;
              }

              BaseArray baseArray = elem as BaseArray;
//.........这里部分代码省略.........
开发者ID:huni35,项目名称:RevitLookup,代码行数:101,代码来源:CollectorExtElement.cs

示例3: IsExpectedElement

        /// <summary>
        /// the selected element must be a structural Column/brace/Beam/Wall/Wall Foundation/Slab/Foundation Slab.
        /// </summary>
        /// <returns></returns>
        private bool IsExpectedElement(Element element)
        {
            // judge the element's type. If it is any type of FamilyInstance, Wall, Floor or
            // WallFoundation, then get judge if it has a AnalyticalModel.
            if (null == element.GetAnalyticalModel())
            {
                return false;
            }

            FamilyInstance familyInstance = element as FamilyInstance;
            if ((null != familyInstance) && (StructuralType.Footing == familyInstance.StructuralType))
            {
                return false; // if selected a isolated foundation not create BC
            }

            if (element is FamilyInstance || element is Wall || element is Floor || element is ContFooting)
            {
                return true;
            }

            return false;
        }
开发者ID:AMEE,项目名称:revit,代码行数:26,代码来源:Command.cs


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