RevitLookup.Test.TestElements.SimpleSlab C# (CSharp) Method

SimpleSlab() public method

Creates a hardwired slab.
public SimpleSlab ( ) : void
return void
        public void SimpleSlab()
        {
            XYZ startPt = new XYZ( 20.0, 0.0, 0.0 );
              XYZ endPt = new XYZ( 20.0, 20.0, 0.0 );

              CurveArray curveArray = m_revitApp.Application.Create.NewCurveArray();

              XYZ location1 = GeomUtils.kOrigin;
              XYZ location2 = new XYZ( 0.0, 10.0, 0.0 );
              XYZ location3 = new XYZ( 10.0, 10.0, 0.0 );
              XYZ location4 = new XYZ( 10.0, 0.0, 0.0 );

              curveArray.Append( Line.CreateBound( location1, location2 ) );
              curveArray.Append( Line.CreateBound( location2, location3 ) );
              curveArray.Append( Line.CreateBound( location3, location4 ) );
              curveArray.Append( Line.CreateBound( location4, location1 ) );

              Level level = m_revitApp.ActiveUIDocument.Document.ActiveView.GenLevel;
              Line line = Line.CreateBound( startPt, endPt );

              m_revitApp.ActiveUIDocument.Document.Create.NewSlab( curveArray, level, line, 45.0, false );
        }