What are your #RTCNA2016 API Wishes?

It’s that time of year again. Another Revit Technology Conference is up and running (or maybe walking to avoid a Phoenix heat-stroke) and Boost Your BIM is here to grant your API wishes!

Here are some examples of wishes that have been granted in the past. Please send your new wishes for interesting and useful ways the API might be able to help you make Revit better. Wishes can be tweeted to @BoostYourBIM or left as comments to this post

22 thoughts on “What are your #RTCNA2016 API Wishes?

      • I believe this could be resolved by running an open file dialog. Then selecting the file/group and copying and pasting the elements from that file into another opened project and then closing the remnants of the opened group.

  1. View Ranges in Section to show graphically like a space in section (with Interior checked on) . Allow me to drag the box up/down to level if desired otherwise keep “Level Above”.

    Another one… In Activate View event, If active workset contains “XX”, show task dialog warning user they are about to draw on an incorrect workset. We lock out users from “XX Shared Levels and Grids”, “XX Scope Boxes”, and “XX Links”

    Thank you,

  2. Recent Files Screen
    Many times I will open projects or families to view some amount of info then close without re-saving since I did not change anything. The action of opening and viewing a project or family, whether making changes and saving or viewing only with no changes, seems to bump all my other projects and or families to the right in the ordering of the 4 available thumb nails on the recent files start up page and eventually off the screen.

    It appears at least 10 files are saved in the .ini file and I know this can be edited in the .ini file, but it would be nice to have a selection box near the thumb nail view to delete the thumbnail then allow the more important files to move left in the 4 file hierarchy. Maybe even a selection box to pin the file on the start up page like it can be pinned in the recent files list accessed from the ribbon.

    While we are thinking about this recent files page, there sure seems to be a lot of dark space below the families thumb nails. Would the use of an API be appropriate to put a company logo or rendering view here?

    • For the first part of your question, you could use the API to detect when a file is closed but not saved and then modify the [Recent File List] section of the Revit.ini file

      For the rest of your ideas, I don’t think Autodesk makes it possible to customize the Recent Files page.

  3. Hi Harry

    Is it possible to change section line length?
    I tried,

    Element element = doc.GetElement(uidoc.Selection.PickObject(ObjectType.Element));

    BoundingBoxXYZ bb = element.get_BoundingBox(doc.ActiveView);

    using (Transaction t = new Transaction(doc, “Section”))
    bb.Min = new XYZ(bb.Min.X, 89, bb.Min.Z);

    but it did not work for me. Is there any way to modify the section line by api?
    Thanks in advance….

      • Thanks Harry
        I got another question,
        I want to copy object type from project to project
        i use

        Reference r = uidoc.Selection.PickObject(ObjectType.Element);
        Element element = doc.GetElement(r);
        ElementId elementTypeId = element.GetTypeId();

        Document otherDoc = app.Documents.Cast().Where(d => d.Title != doc.Title).FirstOrDefault();
        if (otherDoc == null)
        TaskDialog.Show(“Error”, “There must be a 2nd document open.”);

        ICollection copyIds = new List();

        CopyPasteOptions cpOpts = new CopyPasteOptions();

        using (Transaction t = new Transaction(otherDoc, “Copy Object Type”))
        ElementTransformUtils.CopyElements(doc, copyIds, otherDoc, Transform.Identity, cpOpts);
        My question,
        is it possible to overwrite type to existing family type ?
        Thanks again…

  4. Creating slab edges programmatically for all edges of a slab. The UI does not allow you to pick all edges of a slab in some cases. For example, on a slab edge that is sloping and curving in plan. Is there a way to get around this in the API by hard setting the reference curve?

  5. Is it possible to create a floor with holes and shape handles from topography that is split to have holes? I’m running into a issue with not being able to distinguish interior boundary points/loops from exterior ones. It may just be a limitation with the Revit API.

      • It is code that you have shared in one of your Udemy courses, except that it is unable to create a floor when a topography is split so that it has a “hole.” In another macro, I’m looking at using OpenNurbs to convert the Revit topography mesh to a Rhino mesh in order to find the interior and exterior boundaries of the topography to handle them differently. I don’t see another way through the Revit API do you?

        public void topoToNewFloor()
        Document doc = this.ActiveUIDocument.Document;
        UIDocument uidoc = this.ActiveUIDocument;
        Autodesk.Revit.ApplicationServices.Application app = this.Application;

        TopographySurface ts = doc.GetElement(uidoc.Selection.PickObject(ObjectType.Element,”Select topo”)) as TopographySurface;
        IList points = sortPoints(ts.GetBoundaryPoints());

        Floor floor = null;

        using (Transaction t = new Transaction(doc, “Make Floor”))

        CurveArray ca = new CurveArray();
        XYZ prev = null;
        foreach (XYZ bpnt in points)
        if (prev == null)
        prev = points.Last();

        Line line = Line.CreateBound(new XYZ(prev.X,prev.Y,0),new XYZ(bpnt.X,bpnt.Y,0));
        prev = bpnt;
        XYZ origin = new XYZ(0, 0, 0);
        XYZ normal = new XYZ(1, 1, 0);
        Plane geomPlane = app.Create.NewPlane(normal, origin);

        // Create a sketch plane in current document
        SketchPlane sketch = SketchPlane.Create(doc, geomPlane);

        // Create a ModelLine element using the created geometry line and sketch plane
        doc.Create.NewModelCurveArray(ca, sketch);

        floor = doc.Create.NewFloor(ca, false);

        catch (Exception ex)
        TaskDialog.Show(“Error”, ca.Size + “\nFloor creation threw exception.\n” + ex.Message);

        if (floor == null)
        TaskDialog.Show(“Error”,”Floor = null”);
        using (Transaction t = new Transaction(doc,”Edit Floor”))
        foreach (XYZ xyz in ts.GetPoints())

  6. #RTCNA2016 Api Wishes :
    – Get and Set a value from Global Parameter
    – List of all the values ​​of a parameter (such as ” Comment “) and generate a viewfilter for each

    Thank you,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s