Ejemplo n.º 1
0
        /// <summary>
        /// Get SpanDirection and SpanDirectionSymobols of Floor
        /// </summary>
        /// <param name="floor"></param>
        void GetSpanDirectionAndSymobls(Floor floor)
        {
            if (null != floor)
            {
                // get SpanDirection angle of Floor(Slab)
                // The angle returned is in radians. An exception will be thrown if the floor
                // is non structural.
                String spanDirAngle = "Span direction angle: " + floor.SpanDirectionAngle.ToString() + "\r\n";

                // get span direction symbols of Floor(Slab)
                String               symbols     = "Span direction symbols: \r\n\t";
                ElementArray         symbolArray = floor.SpanDirectionSymbols;
                ElementArrayIterator symbolIter  = symbolArray.ForwardIterator();
                symbolIter.Reset();
                while (symbolIter.MoveNext())
                {
                    Element elem = symbolIter.Current as Element;
                    if (elem != null)
                    {
                        symbols += (m_docment.get_Element(elem.GetTypeId()) as ElementType).Name + "\r\n";
                    }
                }

                MessageBox.Show(spanDirAngle + symbols, "Revit Direction", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                new Exception("Get Floor and SpanDirectionAngle and Symbols failed!");
            }
        }