Automatically Open Correct RVT File Version

Today, let's address a couple of quick questions and share a useful utility:

How to Determine Revit Export Image Coordinates

Raised in the StackOverflow question on how to get Revit export image coordinates or reference point:

Question: I want to have a reference point or know the coordinates of any point on an exported Image (from any view) from Revit.

For example, in this Revit floor plan export, I'd like to know the bounding box of the picture, its middle point, or any other reliable reference point:

Floor plan

Is there a way to extract the bounding box coordinates of the picture?

Answer: I would suggest defining two diagonally opposite points in your image file that you can identify precisely in your Revit model.

Determine their image pixel coordinates, export their Revit model coordinates, and use this information to determine the appropriate scaling and translation.

The RoomEditorApp Revit add-in and its corresponding roomedit CouchDb web interface demonstrate exporting an SVG image from Revit, scaling it for display in a web browser, and transformation and calculation of exact coordinates back and forth between two environments.

Response: Thank you for your reply Jeremy, I'm looking into that.

I've noticed the BoundingBoxUV in the view I'm exporting changing based on the elements on the edges of the view; can this bounding box help me determine the exported image bounding box?

The units are different than the "specify coordinates at point", so I'm not sure.

Answer: They might certainly be useful, and almost equally certainly they will not enable any totally reliable and precise transformation.

Therefore, I would still stick with my initial suggestion.

Problems Compiling and Installing the Revit SDK Samples

Question: I'm trying to compile the SDK Revit 2019.2 Samples, but the buttons are disabled:

RvtSamples greyed out

Do you have any suspicion of what may be happening?

Answer: Yes, certainly.

Actually, what you show in the screen snapshot is the external application RvtSamples that creates a user interface to load and launch all the Revit SDK sample external commands.

The problem is probably caused by incorrect paths to the samples being specified in RvtSamples.txt.

I have run into similar issues many times over in the past, e.g., most lately, compiling the Revit 2021 SDK samples and setting up RvtSamples for Revit 2021.

You can check out those two posts and the numerous descriptions of various problems encountered compiling the Revit SDK and installing RvtSamples for previous versions.

RvtVerFileOpen – Open Correct RVT File Version

From a running Revit session, you can easily determine its version number via the application VersionNumber property, cf., e.g., how to get the current build of an open project file?.

Determining the Revit version that saved an RVT file stored in the OS file system and not currently opened in Revit, however, is a different matter.

It can be handled using the BasicFileInfo class, as explained in several places, e.g., the discussion on basic file info and RVT file version.

Vin Gallo now shared a new utility making use of that functionality in his recent comment on that article:

I've written a small app that opens any RVT file in the correct Revit version, simply by double-clicking the file in Windows Explorer.

I have used some of the logic in this thread, which works for all versions of Revit up to 2021.

I can share the source code here, but it's probably better to just share the Visual Studio Source, if anybody is interested.

Here's a short video.

Source Code.

To make it work, you'll have to associate RVT files with this app.

Many thanks to Vin for implementing and sharing this!

For safety's sake, I made local copies of his video and source code here:

Angular and React Tutorials

Let's round off with some pretty impressive and pretty basic web related stuff, respectively:

Give and Take

Finally, a short note on giving and taking:

The most successful developers share more than they take.

This doesn't just apply to developers, by the way, but to BIM experts as well, cf. Håvard Vasshaug on Learning Dynamo and Sharing Content .

I love and believe in sharing and open source, cf. my old Book Recommendation: The Cathedral and the Bazaar.