What new apps should I build for the ADSK Portathon?

Autodesk is generously offering me (and everyone else) $100 each for submitting up to 5 new apps to http://apps.exchange.autodesk.com/en.

So friends, what new apps should I create?

P.S. The apps need to be submitted to Autodesk by September 14, so small/medium sized utilities will be a better fit than big projects like an FBX Importer

SAuBIM – Code Calcs for Revit 2013 & 2014

SAuBIM Version 2.0, an add-in for updating your occupant load tags with the click of a button, is now available. Boost Your BIM partnered with The Revit Kid to create this new version that uses the Revit API to integrate with Revit 2013 and Revit 2014.

Download and purchase it here. Use offer code “BOOSTBIMKID” for an extra 15% off today only!

Set graphic overrides for an element in a view

2014 includes a new View.SetElementOverrides that can be used to set view-specific graphic overrides for a specific element.

public void ElementOverride()
{
    Document doc = this.ActiveUIDocument.Document;
    UIDocument uidoc = this.ActiveUIDocument;
    ElementId id = uidoc.Selection.PickObject(ObjectType.Element,"Select an element").ElementId;
    OverrideGraphicSettings ogs = new OverrideGraphicSettings();
    ogs.SetProjectionLineColor(new Color(0,255,0));
    using (Transaction t = new Transaction(doc,"Set Element Override"))
    {
        t.Start();
        doc.ActiveView.SetElementOverrides(id, ogs);
        t.Commit();
    }
}

Click twice to create a cropped dependent view

Here is how  to prompt the user to click twice and use those points to create a new dependent view cropped to the rectangle formed by those points.

public void MakeViewAndSheetWith2Clicks()
{
    Document doc = this.ActiveUIDocument.Document;
    UIDocument uidoc = new UIDocument(doc);

    // prompt user to pick two points
    XYZ lowLeftPickPoint = uidoc.Selection.PickPoint("Pick lower left corner");
    XYZ upRightPickPoint = uidoc.Selection.PickPoint("Pick upper right corner");

    // create a new BoundingBoxXYZ & set its Min and Max to the XYZ points selected by the user
    BoundingBoxXYZ bboxFromPicks = new BoundingBoxXYZ();
    bboxFromPicks.Min = lowLeftPickPoint;
    bboxFromPicks.Max = upRightPickPoint;

    // Find a titleblock in the project, or use InvalidElementId to create a sheet with no titleblock
    ElementId titleblockId = ElementId.InvalidElementId;
    FamilySymbol titleBlockSymbol = doc.TitleBlocks.Cast<FamilySymbol>().FirstOrDefault();
    if (titleBlockSymbol != null)
        titleblockId = titleBlockSymbol.Id;

    ViewSheet sheet = null;
    using (Transaction t = new Transaction(doc,"crop"))
    {
        t.Start();

        // duplicate the active view
        ElementId newViewId = doc.ActiveView.Duplicate(ViewDuplicateOption.AsDependent);
        View newView = doc.GetElement(newViewId) as View;

        // set the crop box of the new view to the bounding box created from the two picked points
        newView.CropBox = bboxFromPicks;

        // Create the new sheet
        sheet = ViewSheet.Create(doc, titleblockId);

        newView.Name = sheet.Name + "-" + sheet.SheetNumber;
        newView.Scale = 10;

        // Create the viewport to put the new view on the new sheet at (0,0,0)
        Viewport.Create(doc, sheet.Id, newViewId, XYZ.Zero);
        t.Commit();
    }
    // make the new sheet the active view
    uidoc.ActiveView = sheet;
}

Create a View/Sheet Set


public void CreateSheetSet()
{
    Document doc = this.ActiveUIDocument.Document;

    // create a new ViewSet - add views to it that match the desired criteria
    ViewSet myViewSet = new ViewSet();
    string match = "S";
    foreach (ViewSheet vs in new FilteredElementCollector(doc).OfClass(typeof(ViewSheet)).Cast<ViewSheet>()
             .Where(q => q.SheetNumber.Contains(match)))
    {
        myViewSet.Insert(vs);
    }

    // get the PrintManger from the current document
    PrintManager printManager = doc.PrintManager;

    // set this PrintManager to use the "Selected Views/Sheets" option
    printManager.PrintRange = PrintRange.Select;

    // get the ViewSheetSetting which manages the view/sheet set information of current document
    ViewSheetSetting viewSheetSetting = printManager.ViewSheetSetting;

    // set the views in this ViewSheetSetting to the newly created ViewSet
    viewSheetSetting.CurrentViewSheetSet.Views = myViewSet;

    if (myViewSet.Size == 0)
    {
        TaskDialog.Show("Error", "No sheet numbers contain '" + match + "'.");
        return;
    }

    using (Transaction t = new Transaction(doc,"Create ViewSet"))
    {
        t.Start();
        string setName = "'" + match +"' Sheets";
        try
        {
            // Save the current view sheet set to another view/sheet set with the specified name.
            viewSheetSetting.SaveAs(setName);
        }
        // handle the exception that will occur if there is already a view/sheet set with this name
        catch (Autodesk.Revit.Exceptions.InvalidOperationException)
        {
            TaskDialog.Show("Error", setName + " is already in use");
            t.RollBack();
            return;
        }
        t.Commit();
    }
    TaskDialog.Show("View Set", myViewSet.Size + " sheets added to set");
}