Nice tip + addin coming from Trevor Taylor via Jeremy Tammik – it shows how to rename Interior Elevation views by the Room that they reside in.
Here is a complete sample project including a test model in case you’d like to check it out yourself.
Many thanks to Trevor for this useful tool, his research, implementation, and generous sharing.
Read more / via:
The Building Coder: Rename View by Matching Elevation Tag with Room
I had one of those slap-your-head moments when this finally came to me … use Coins Auto Section Box!
Step by step:
- Close Revit
- Install Coins Auto Section Box
- Open Revit
- Open a project
- Draw a Scope Box
- Go to a 3D view where you want to match the Scope Box
- Select the Scope Box
- Go to Add-Ins > Auto Section Box
- Set Element extents, plus buffer: to 0
- Hit OK!
The 3D view now has a Section Box that matches the selected Scope Box.
I previously tried to implement some sample code from The Building Code, but couldn’t make it work (see below the lines). I’m sure this is due to my less-than-optimal API skills…
How to compile code SLN for Revit (using Building Coder as example:)
- Download the ZIP
- Unzip it
- Double click SetSectionBox.sln and open it in Visual C# Express (or use SharpDevelop, see below)
- Click on the Reference Paths side-tab
- Using the … add your Program FilesAutodeskRevit 2013Program directory
it is looking for RevitAPI.dll and RevitAPIUI.dll
- Right-click on the SetSectionBox node and press build
- Find the setsectionboxsrcSetSectionBoxSetSectionBoxbinRelease folder, and copy the SetSectionBox.dll
- Paste it into %AppData%AutodeskRevitAddins2013
- If it isn’t already there, paste SetSectionBox.addin into the same folder.
Revit 2013 ships with the open source IDE SharpDevelop.
If you want to use SharpDevelop:
“yourdrive:Program FilesAutodeskRevit 2013ProgramSDAbinSharpDevelop.exe”
Just drag and drop the solution file into the SharpDevelop window.
Running the command, I get a couple of different errors. One is:
Revit encountered a Autodesk.Revit.Exceptions.ArgumentException: Box is
Parameter name: box
at Autodesk. Revit.DB.View3D.set_SectionBox(BoundingBoxXYZ section Box)
commandData, String& message, ElementSet elements)
at apiManagedExecuteCommand(AString* assemblyName, AString*
className, AString* vendorDescription, MFCApp* pMFCApp, DBView*
pDBView, AString* message,
Set< Elementldstd::less tnallc< Elementld> > • ids,
Map tnallc > * data, AString*
exceptionName, AString* exceptionMessage)
Here is SetSectionBox.zip containing the complete source code, Visual Studio solution, and add-in manifest of this command.
The Building Coder: Set View Section Box to Match Scope Box
To follow up the discussion of my quick and dirty Revit model OBJ exporter, I want to point out that Adam Nagy completed his series of posts on the AEC DevBlog on a Revit model exporter and viewer for iOS using an even more minimalistic custom data format for uploading to the cloud and viewing on an iOS mobile device:
- Part 1: Revit add-in to upload geometry data to a storage service
- Part 2: An iOS application to download and display the model using OpenGL
- Part 3: Interactive view orientation and manipulation using gestures
While the OBJ format I looked at is more heavy-weight than Adam’s minimal custom format, my implementation includes some other enhancements which make it quite effective as well.
I have also heard of other home-grown viewer implementations with some support for switchback, individual element tagging and object identification based on VRML and on the Unity gaming engine.
If you are interested in a finely tuned exporter with more complete coverage and control over what gets exported, you might want to take a look at the open source STL exporter.
Finally, for high-end exporter requirements, the Revit IFC exporter is also open source.
The Building Coder: Running Language Code and More Exporters
RevitPythonShell has some competition! Its called RevitRubyShell.
RevitRubyShell on Github – installer
What is Ruby? Ruby is a dynamic, reflective, general-purpose object-oriented programming language that combines syntax inspired by Perl with Smalltalk-like features…Ruby supports multiple programming paradigms, including functional, object oriented, imperative and reflective.
Thanks to Håkon Clausen, Ruby is now friends with Revit.
Quote from The Building Coder:
Last week, I provided a short description of the interactive real-time Revit programming environment RevitRubyShell provided by Håkon Clausen and mentioned how impressed I was by its minimalistic single-click installer.
The Building Coder: RevitRubyShell Implementation and Installer
Thanks to Jeremy Tammik at The Building Coder:
The recording of the Revit 2013 API webcast that we held on May 17 is now available from the ADN DevTech Webcast Recordings Archive, entering “Revit API” as the course topic, or directly from here.
The 34 MB zip file includes:
- Slide deck
- Code Samples
The webcast addresses two main areas: an introduction to Revit programming for beginners, including a quick walkthrough of basic concepts, and a discussion of some of the new functionality provided by the Revit 2013 API, which will be of interest to both beginners and experienced developers. The two parts are roughly equal in length.
The Building Coder: Revit 2013 API Webcast Recording
The Building Coder has put together a very advanced post that essentially demonstrates that the Revit API can sample an external, continuously changing graphical ‘feed’, and then display this inside Revit itself. Cool!
Now, I challenge someone to grab the live feed from a webcam looking out a real-life window, and then show me it presenting itself through a Revit Window family 🙂
Here is RevitWebcam2012_3_final_cleanup.zip containing the cleaned up code with all obsolete API usage removed.
Here is a snapshot of RevitWebcam up and running in Revit 2012:
Read more / via
The Building Coder: Revit Webcam 2012
Whether you prefer C# or VB.Net for Revit API add-in development is probably a matter of preference. So for those of you who haven’t heard yet:
Based on popular demand, we have now added new VB.NET samples.
So regardless whether you are new to this training or have already gone through it once with the C# code, now is your chance to choose the language you prefer, C# or VB.Net, at www.autodesk.com/myfirstrevitplugin.
The Building Coder: My First Revit Plug-in in VB