.Net sample: StructSample. This command places a set of coulmns in the selected wall. /// Note that Revit uses Feet as an internal length unit. (1) Draw some walls, and constrain their top and bottom to the levels in the properties dialog. (2) Run the test. It will place columns along each wall with the interval of 5 feet. (The interval is also hard coded.)
Ejemplo n.º 1
0
        StructSample()
        {
            //// first filter out to only Wall elements
            //ElementSet selectedElements = Utils.Selection.FilterToCategory( m_revitApp.ActiveUIDocument.Selection.Elements,
            //                                              BuiltInCategory.OST_Walls, false, m_revitApp.ActiveUIDocument.Document );

            //if( selectedElements.IsEmpty )
            //{
            //  MessageBox.Show( "No wall elements are currently selected" );
            //  return;
            //}

            //StructuralSample.StructSample sample = new StructuralSample.StructSample( m_revitApp, selectedElements );

            // First filter out to only Wall elements
            ICollection <ElementId> selectedElementIds
                = Utils.Selection.FilterToCategory(
                      m_revitApp.ActiveUIDocument.Selection.GetElementIds(),
                      BuiltInCategory.OST_Walls, false,
                      m_revitApp.ActiveUIDocument.Document);

            if (0 == selectedElementIds.Count)
            {
                MessageBox.Show("No wall elements are currently selected");
                return;
            }

            StructuralSample.StructSample sample = new StructuralSample.StructSample(m_revitApp, selectedElementIds);
            sample.ExecuteStructSample();
        }
Ejemplo n.º 2
0
        StructSample()
        {
            // first filter out to only Wall elements
            ElementSet selectedElements = Utils.Selection.FilterToCategory(m_revitApp.ActiveUIDocument.Selection.Elements,
                                                                           BuiltInCategory.OST_Walls, false, m_revitApp.ActiveUIDocument.Document);

            if (selectedElements.IsEmpty)
            {
                MessageBox.Show("No wall elements are currently selected");
                return;
            }

            StructuralSample.StructSample sample = new StructuralSample.StructSample(m_revitApp, selectedElements);
            sample.ExecuteStructSample();
        }
Ejemplo n.º 3
0
    StructSample()
    {
      //// first filter out to only Wall elements
      //ElementSet selectedElements = Utils.Selection.FilterToCategory( m_revitApp.ActiveUIDocument.Selection.Elements,
      //                                              BuiltInCategory.OST_Walls, false, m_revitApp.ActiveUIDocument.Document );

      //if( selectedElements.IsEmpty )
      //{
      //  MessageBox.Show( "No wall elements are currently selected" );
      //  return;
      //}

      //StructuralSample.StructSample sample = new StructuralSample.StructSample( m_revitApp, selectedElements );

      // First filter out to only Wall elements
      ICollection<ElementId> selectedElementIds
        = Utils.Selection.FilterToCategory(
          m_revitApp.ActiveUIDocument.Selection.GetElementIds(),
          BuiltInCategory.OST_Walls, false,
          m_revitApp.ActiveUIDocument.Document );

      if( 0 == selectedElementIds.Count )
      {
        MessageBox.Show( "No wall elements are currently selected" );
        return;
      }

      StructuralSample.StructSample sample = new StructuralSample.StructSample( m_revitApp, selectedElementIds );
      sample.ExecuteStructSample();
    }
Ejemplo n.º 4
0
        public void StructSample()
        {
            // first filter out to only Wall elements
            ElementSet selectedElements = Utils.Selection.FilterToCategory(m_revitApp.ActiveUIDocument.Selection.Elements,
                                                          BuiltInCategory.OST_Walls, false, m_revitApp.ActiveUIDocument.Document);

            if (selectedElements.IsEmpty)
            {
                MessageBox.Show("No wall elements are currently selected");
                return;
            }

            StructuralSample.StructSample sample = new StructuralSample.StructSample(m_revitApp, selectedElements);
            sample.ExecuteStructSample();
        }