Thursday, November 17, 2016

AU2016 SD20868

Autodesk University 2016 has come to a close for us now and it was very enlightening and entertaining. I enjoyed catching up with old friends and making a few new ones as well.

I taught a class entitled "SD20868 - Revit Usage and Model Data Reporting Simplified with C#"

It was a full solution style overview class showing how to get verb data out of Revit and into a graphical dashboard showing various Model and User metrics.

The purpose was to show and share how this can be done using ASP.NET coupled with a few other modern(ish) web development techniques. I want to thank the folks that provide the Gentelella web template and hope everyone enjoyed the class.

Tuesday, August 23, 2016

Revit Key Schedule Data Export

Have you ever had a need to export all of your key schedule data? The sample code provided below was built for Revit 2015 and should upgrade just fine to newer versions if need be.

Since you cannot transfer updates to existing Key Schedules from one project to another, I needed a way to export the data to a standardized key schedule definition so that I could easily import that updated definition information to a new or existing key schedule in an external project. This sample code is what I am using to export all of my key schedules including all of their row data to json file.

Sample data visualization thanks to our friends at

No I will not make a Dynamo definition for this :)


Wednesday, April 27, 2016

Delete Empty Elevation Marker Tags

It is pretty common for a model to end up with a bunch of abandoned elevation marker tags. There are a bunch of ways that this can happen and depending on how you have your elevation tag symbols defined can be difficult to find visually for removal.

One of the supreme beings that I used to work with at CASE built a means of doing this in Dynamo.

This is a simple routine that finds these and eradicates them from your model...

Friday, April 1, 2016

Getting Families to Display in RCP if Below View Cut Plane

I haven't posted anything in quite a while and plan to start posting more often again. I've got loads of new code related ideas that I will be posting in the not so distant future, but for now, we're going to show a popular family editing trick to get elements to display in RCP views when their base geometry might dictate otherwise.

Plan regions are not necessary to solve this issue...

This trick is also handy for furniture elements (tables, etc.) that you wish to be visible in RCP views even though they don't contain any visible geometry above the RCP view range cut plane.

Open your family in the editor and add a new model line to the top of your family so that the top of this line will always extend just beyond your view range cut plane in the project environment. Be sure to set this model line to invisible so that you don't see it anywhere in the project environment.

Your element will not be visible in an RCP view with a cut plane higher than the top of your geometry since the model line passes through it in the project environment. Revit will display the whole family for you.

Friday, April 24, 2015

Today is my Last Day at CASE

First off, let me say that I am very grateful to have had the opportunity to join and to have made the decision to join CASE back in the summer of 2011 and regret nothing. The leadership there always made me feel welcome and it was totally worth the ride!

We were less than 10 employees in the USA with another group of 4 down in Montevideo. CASE is now 60+ people strong all over the globe. We triumphed through everything put in front of us and served the AEC industry in what I like to believe was a positive way. I'm certain we will all remain good friends and colleagues going forward.

My decision to leave was difficult, but one that I had to make. I need to get back to work in my local market in the city that I love... Austin, TX. I feel confident that I am leaving my legacy in capable hands and that CASE will continue to improve well into the future.

Special thanks to Dave Fano and Federico Negro for finding me and convincing me to join their weird club! I'll miss working with you freaks! I'll be sending you guys some bootlegged CASE Polo Shirts.

Friday, November 21, 2014

Revit Dockable Pane Failures with Windows 8 Video Scaling

I'm not sure if this is a bug, or just something that I'm missing, but there is definitively something weird with how Revit dockable pages display on systems that implement video scaling, namely windows 8.1 on retina displays.

Let me first start by explaining what I mean by video scaling. Windows has a feature under display settings that allows you to "scale" objects on your display. This is different from the use of resolution. Here's an illustration of what I'm talking about:

The dockable page in question is basically divided up into two even columns down the center. When the Windows video scaling is set to anything other than 100%, it throws off the coordination between the grid and the host page width. Sorry for having to blur out the controls, but here is a sample of what my dockable page looks like (cutting off about 50% on right hand side):

I went through the normal process of handling this through traditional WPF windows means thinking that I'd be out of the woods, but nope. My dockable page object is surrounded by one master grid, but for some reason on systems with video scaling active, this grid does not know how large it is supposed to be. The whacky result is what you see above with the cut-off issues.

The "traditional" code that should have worked, but did not is shown below. It gets the video scaling from the Matrix object and then applies that value to the ScaleTransform of my MasterGrid which is of course the base grid at the top level of the page layout.

        private void MainPage_Loaded(object sender, RoutedEventArgs e)
            Matrix m = PresentationSource.FromVisual(Application.Current.MainWindow).CompositionTarget.TransformToDevice;
            double dx = m.M11;
            double dy = m.M22;

            ScaleTransform s = (ScaleTransform)MasterGrid.LayoutTransform;
            s.ScaleX = 1 / dx;
            s.ScaleY = 1 / dy;

What I ended up having to do was first get the scaling values from the matrix object (similar to above) and then use the SizeChanged event on my Revit dockable page to adjust the width and height to match the size of the page object.

The code that ended up working for adjusting the host grid object size with scaling is shown here.

    private void MainPage_Loaded(object sender, RoutedEventArgs e)
      Matrix m = PresentationSource.FromVisual(this).CompositionTarget.TransformToDevice;
      double dx = m.M11;
      double dy = m.M22;
      GridMain.Width = this.Width / dx;
      GridMain.Height = this.Height / dy;

The code above gets the current Windows video scaling in the same way, but the difference is that instead of applying scaling, we're just calculating the corrected widths and heights for the form. Here's how the page looks after the updates (slightly less blur):

I'm curious if anyone else has run into this and if so, how did you deal with it?

Wednesday, July 23, 2014

It's Been a While

Well you guys, a year has passed and you'll see some fresh posts. I had some contractual terms preventing me from being able to post anything here for a while, but that excuse is no more (always be careful about what you sign).

In other news, I'll be teaching a class at Autodesk University 2014 in December entitled "Using Revit API Events to Manage Miracles." The class ID is SD5399 and I'll be talking about... you guessed it... Revit API Events! Hopefully I don't get stuck with the last time slot of the entire event like I did last time (first session of the conference is pretty tough also though).