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


C# Autodesk.GetElement方法代码示例

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


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

示例1: ElementSet

 public ElementSet(string label, ICollection<Autodesk.Revit.DB.ElementId> val, Autodesk.Revit.DB.Document doc)
     : base(label)
 {
     m_val = new Autodesk.Revit.DB.ElementSet();
     foreach(Autodesk.Revit.DB.ElementId elemId in val)
     {
         if(Autodesk.Revit.DB.ElementId.InvalidElementId == elemId)
             continue;
         Autodesk.Revit.DB.Element elem = doc.GetElement(elemId);
         if(null != elem)
             m_val.Insert(elem);
     }
 }
开发者ID:halad,项目名称:RevitLookup,代码行数:13,代码来源:ElementSet.cs

示例2: Enumerable

        public Enumerable(string label, IEnumerable val, Autodesk.Revit.DB.Document doc)
            : base(label)
        {
            m_val = val;

            // iterate over the collection and put them in an ArrayList so we can pass on
            // to our Form
            if (m_val != null)
            {
                IEnumerator iter = m_val.GetEnumerator();
                while (iter.MoveNext())
                {
                    if (iter.Current is Autodesk.Revit.DB.ElementId)    // it's more useful for user to view element rather than element id.
                    {
                        Autodesk.Revit.DB.ElementId elemId = iter.Current as Autodesk.Revit.DB.ElementId;
                        m_objs.Add(doc.GetElement(elemId));
                    }
                    else
                        m_objs.Add(iter.Current);
                }
            }
        }
开发者ID:halad,项目名称:RevitLookup,代码行数:22,代码来源:Enumerable.cs

示例3: ExportAreaSchemes

 /// <summary>
 /// Export Area Schemes.
 /// </summary>
 /// <param name="document">The Revit document.</param>
 /// <param name="exporterIFC">The exporterIFC class.</param>
 protected void ExportAreaSchemes(ExporterIFC exporterIFC, Autodesk.Revit.DB.Document document)
 {
     foreach (ElementId elementId in ExporterCacheManager.AreaSchemeCache.Keys)
     {
         Element element = document.GetElement(elementId);
         ExportElement(exporterIFC, element);
     }
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:13,代码来源:Exporter.cs

示例4: ExportBeamSystems

 /// <summary>
 /// Export BeamSystems.  These could be in assemblies, so do before assembly export, but after beams are exported.
 /// </summary>
 /// <param name="document">The Revit document.</param>
 /// <param name="exporterIFC">The exporterIFC class.</param>
 protected void ExportBeamSystems(ExporterIFC exporterIFC, Autodesk.Revit.DB.Document document)
 {
     foreach (ElementId elementId in ExporterCacheManager.BeamSystemCache)
     {
         Element element = document.GetElement(elementId);
         ExportElement(exporterIFC, element);
     }
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:13,代码来源:Exporter.cs

示例5: ExportCachedFabricAreas

 /// <summary>
 /// Export FabricAreas cached during non-spatial element export.  
 /// We export whatever FabricAreas actually have handles as IfcGroup.
 /// </summary>
 /// <param name="document">The Revit document.</param>
 /// <param name="exporterIFC">The exporterIFC class.</param>
 protected void ExportCachedFabricAreas(ExporterIFC exporterIFC, Autodesk.Revit.DB.Document document)
 {
     foreach (ElementId elementId in ExporterCacheManager.FabricAreaHandleCache.Keys)
     {
         Element element = document.GetElement(elementId);
         ExportElement(exporterIFC, element);
     }
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:14,代码来源:Exporter.cs

示例6: ExportCachedRailings

 /// <summary>
 /// Export railings cached during spatial element export.  
 /// Railings are exported last as their containment is not known until all stairs have been exported.
 /// This is a very simple sorting, and further containment issues could require a more robust solution in the future.
 /// </summary>
 /// <param name="document">The Revit document.</param>
 /// <param name="exporterIFC">The exporterIFC class.</param>
 protected void ExportCachedRailings(ExporterIFC exporterIFC, Autodesk.Revit.DB.Document document)
 {
     foreach (ElementId elementId in ExporterCacheManager.RailingCache)
     {
         Element element = document.GetElement(elementId);
         ExportElement(exporterIFC, element);
     }
 }
开发者ID:whztt07,项目名称:RevitIFC,代码行数:15,代码来源:Exporter.cs

示例7: ExportIFC

        /// <summary>
        /// Implements the method that Autodesk Revit will invoke to perform an export to IFC.
        /// </summary>
        /// <param name="document">The document to export.</param>
        /// <param name="exporterIFC">The IFC exporter object.</param>
        /// <param name="filterView">The view whose filter visibility settings govern the export.</param>
        public void ExportIFC(Autodesk.Revit.DB.Document document, ExporterIFC exporterIFC, Autodesk.Revit.DB.View filterView)
        {
            try
            {
                // cache options
                ExportOptionsCache exportOptionsCache = ExportOptionsCache.Create(exporterIFC, filterView);
                ExporterCacheManager.ExportOptionsCache = exportOptionsCache;

                ElementFilteringUtil.InitCategoryVisibilityCache();
                
                //begin export
                BeginExport(exporterIFC, document);

                FilteredElementCollector spatialElementCollector;
                FilteredElementCollector otherElementCollector;
                ICollection<ElementId> idsToExport = exportOptionsCache.ElementsForExport;
                if (idsToExport.Count > 0)
                {
                    spatialElementCollector = new FilteredElementCollector(document, idsToExport);
                    otherElementCollector = new FilteredElementCollector(document, idsToExport);
                }
                else
                {
                    spatialElementCollector = (filterView == null) ?
                        new FilteredElementCollector(document) : new FilteredElementCollector(document, filterView.Id);
                    otherElementCollector = (filterView == null) ?
                        new FilteredElementCollector(document) : new FilteredElementCollector(document, filterView.Id);
                }

                bool spaceExported = true;
                if (exportOptionsCache.SpaceBoundaryLevel == 2)
                {
                    SpatialElementExporter.ExportSpatialElement2ndLevel(this, exporterIFC, document, filterView, ref spaceExported);
                }

                //export spatial element - none or 1st level room boundaries
                //  or create IFC Space only if 2nd level room boundaries export failed
                if (exportOptionsCache.SpaceBoundaryLevel == 0 || exportOptionsCache.SpaceBoundaryLevel == 1 || !spaceExported)
                {
                    SpatialElementExporter.InitializeSpatialElementGeometryCalculator(document, exporterIFC);
                    ElementFilter spatialElementFilter = ElementFilteringUtil.GetSpatialElementFilter(document, exporterIFC, filterView);
                    spatialElementCollector.WherePasses(spatialElementFilter);
                    foreach (Element element in spatialElementCollector)
                    {
                        ExportElement(exporterIFC, filterView, element);
                    }
                }

                //export other elements
                ElementFilter nonSpatialElementFilter = ElementFilteringUtil.GetNonSpatialElementFilter(document, exporterIFC, filterView);
                otherElementCollector.WherePasses(nonSpatialElementFilter);
                foreach (Element element in otherElementCollector)
                {
                    ExportElement(exporterIFC, filterView, element);
                }

                // Export railings cached above.  Railings are exported last as their containment is not known until all stairs have been exported.
                // This is a very simple sorting, and further containment issues could require a more robust solution in the future.
                foreach (ElementId elementId in ExporterCacheManager.RailingCache)
                {
                    Element element = document.GetElement(elementId);
                    ExportElement(exporterIFC, filterView, element);
                }

                ConnectorExporter.Export(exporterIFC);

                // end export
                EndExport(exporterIFC, document);
            }
            finally
            {
                ExporterCacheManager.Clear();

                if (m_Writer != null)
                    m_Writer.Close();

                if (m_IfcFile != null)
                {
                    m_IfcFile.Close();
                    m_IfcFile = null;
                }
            }
        }
开发者ID:whztt07,项目名称:BIM-IFC,代码行数:89,代码来源:Exporter.cs

示例8: ExportZones

 /// <summary>
 /// Export Zones.
 /// </summary>
 /// <param name="document">The Revit document.</param>
 /// <param name="exporterIFC">The exporterIFC class.</param>
 protected void ExportZones(ExporterIFC exporterIFC, Autodesk.Revit.DB.Document document)
 {
     HashSet<ElementId> zoneCollection = ExporterCacheManager.ZoneCache;
     int zoneIndex = 1;
  int zoneCollectionCount = zoneCollection.Count;
     foreach (ElementId elementId in ExporterCacheManager.ZoneCache)
     {
     statusBar.Set(String.Format(Resources.IFCProcessingExportZones, zoneIndex, zoneCollectionCount, elementId));
     zoneIndex++;
         Element element = document.GetElement(elementId);
         ExportElement(exporterIFC, element);
     }
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:18,代码来源:Exporter.cs

示例9: ExportBeamSystems

 /// <summary>
 /// Export BeamSystems.  These could be in assemblies, so do before assembly export, but after beams are exported.
 /// </summary>
 /// <param name="document">The Revit document.</param>
 /// <param name="exporterIFC">The exporterIFC class.</param>
 protected void ExportBeamSystems(ExporterIFC exporterIFC, Autodesk.Revit.DB.Document document)
 {
    HashSet<ElementId> beamSystemCollection = ExporterCacheManager.BeamSystemCache;
    int beamSystemIndex = 1;
  int beamSystemCollectionCount = beamSystemCollection.Count;
     foreach (ElementId elementId in ExporterCacheManager.BeamSystemCache)
     {
     statusBar.Set(String.Format(Resources.IFCProcessingBeamSystems, beamSystemIndex, beamSystemCollectionCount, elementId));
        beamSystemIndex++;
         Element element = document.GetElement(elementId);
         ExportElement(exporterIFC, element);
     }
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:18,代码来源:Exporter.cs

示例10: ExportCachedFabricAreas

 /// <summary>
 /// Export FabricAreas cached during non-spatial element export.  
 /// We export whatever FabricAreas actually have handles as IfcGroup.
 /// </summary>
 /// <param name="document">The Revit document.</param>
 /// <param name="exporterIFC">The exporterIFC class.</param>
 protected void ExportCachedFabricAreas(ExporterIFC exporterIFC, Autodesk.Revit.DB.Document document)
 {
    IDictionary<ElementId, HashSet<IFCAnyHandle>> fabricAreaCollection = ExporterCacheManager.FabricAreaHandleCache;
    int fabricAreaIndex = 1;
  int fabricAreaCollectionCount = fabricAreaCollection.Count;
     foreach (ElementId elementId in ExporterCacheManager.FabricAreaHandleCache.Keys)
     {
     statusBar.Set(String.Format(Resources.IFCProcessingFabricAreas, fabricAreaIndex, fabricAreaCollectionCount, elementId));
         fabricAreaIndex++;
         Element element = document.GetElement(elementId);
         ExportElement(exporterIFC, element);
     }
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:19,代码来源:Exporter.cs

示例11: ExportCachedRailings

 /// <summary>
 /// Export railings cached during spatial element export.  
 /// Railings are exported last as their containment is not known until all stairs have been exported.
 /// This is a very simple sorting, and further containment issues could require a more robust solution in the future.
 /// </summary>
 /// <param name="document">The Revit document.</param>
 /// <param name="exporterIFC">The exporterIFC class.</param>
 protected void ExportCachedRailings(ExporterIFC exporterIFC, Autodesk.Revit.DB.Document document)
 {
     HashSet<ElementId> railingCollection = ExporterCacheManager.RailingCache;
     int railingIndex = 1;
  int railingCollectionCount = railingCollection.Count;
     foreach (ElementId elementId in ExporterCacheManager.RailingCache)
     {
     statusBar.Set(String.Format(Resources.IFCProcessingRailings, railingIndex, railingCollectionCount, elementId));
         railingIndex++;
         Element element = document.GetElement(elementId);
         ExportElement(exporterIFC, element);
     }
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:20,代码来源:Exporter.cs


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