© 2010 Autodesk
Introduction to Revit 2011 API
Lab - User Selection
Create House Pick
<CS>
    XYZ pt1 = rvtUIDoc.Selection.PickPoint("Pick the first corner of walls");
    XYZ pt2 = rvtUIDoc.Selection.PickPoint("Pick the second corner");
    //' simply create four walls with orthogonal rectangular profile from the two points picked.
    List<Wall> walls = RevitIntroVB.ModelCreation.CreateWalls(rvtUIDoc.Document, pt1, pt2);
    //' pick a wall to add a front door
    SelectionFilterWall selFilterWall = new SelectionFilterWall();
    Reference @ref = rvtUIDoc.Selection.PickObject(ObjectType.Element, selFilterWall, "Select a wall to place a front door");
    Wall wallFront = @ref.Element as Wall;
    //' add a door to the selected wall
    RevitIntroVB.ModelCreation.AddDoor(rvtUIDoc.Document, wallFront);
</CS>