Esempio n. 1
0
        /// <summary>
        /// Get the cross section information for a particular wall.
        /// Will create the information if it doesn't exist.
        /// </summary>
        /// <param name="wallElement">The wall element.</param>
        /// <returns>
        /// The cross section information for a particular wall, or null if invalid.
        /// </returns>
        public WallCrossSectionInfo GetCrossSectionInfo(Wall wallElement)
        {
            if (wallElement == null)
            {
                return(null);
            }

            WallCrossSectionInfo crossSectionInfo = null;
            ElementId            wallId           = wallElement.Id;

            if (!CrossSectionCache.TryGetValue(wallId, out crossSectionInfo))
            {
                crossSectionInfo          = WallCrossSectionInfo.Create(wallElement);
                CrossSectionCache[wallId] = crossSectionInfo;
            }
            return(crossSectionInfo);
        }
Esempio n. 2
0
 /// <summary>
 /// Clears the cache.
 /// </summary>
 public void Clear()
 {
     CrossSectionCache.Clear();
 }