Today we pick up two recent MEP related discussions, on creating a new pipe connector for a hydraulic fitting family and on automatic pipe system routing, and a couple of other odd items
– The names they are a-changin
– Getting a
– Auto-routing a pipe system between plumbing fixtures
– Handling dialogue and failure messages
– Retrieving a geometry reference...
We recently shared a brief note on using the
BreakCurve API for splitting a pipe.
Matt Taylor now pointed out a much more comprehensive discussion asking, is there any API available to split a duct programmatically?
That is not just an example, but an entire tutorial, so I think it is very useful to share here as well for all to enjoy..
So many interesting things going on in the Revit API discussion forum.
Also, the newest DA4R recording is now available online
– Forge Design Automation API for Revit recording
– Design Automation for Revit supports IFC
– What does the
includeShadows flag do?
– Easiest solution to deploy add-in
– Always show the same button in
The ultimatively painless introduction to the Forge Design Automation API, a solution for creating two stacked ribbon items, reinitialising filtered element collectors and picking a face in a linked file
– Forge Design Automation API webinars
– Stacking two 24x24 ribbon items
– Reinitialising the filtered element collector
CreateReferenceInLink to select a face in a linked file...
As high-resolution monitors grow ever more common, an important question arises on handling add-in scaling for 4K high resolution screens – Problem adapting a Revit add-in for 4K displays – Application properties for stand-alone apps – Application manifest – Separate UI component with IPC – Two solutions for adjusting Revit for 4K displays – Method 1 – Run hires monitor in low resolution – Method 2 – Adjust how Revit handles 4k displays – Discussion of the results...
I'll start this week with several solutions from the Revit API discussion forum and elsewhere, especially two different approaches to create rotated rebar stirrups – Embedded tooltip icon resource – Revit 2019 tooltip videos are MP4 – How to read and write bolt, plate and weld – Creating rotated rebar stirrups...
Today is The Building Coder's tenth birthday! The first post was a warm welcome on August 22, 2008. Very many thanks to the entire community for all your support, interest, comments and above all numerous contributions over the years! Today, let's pick up the recurring topic of accessing the Revit API from a modeless context...
The Failure API enables both failure definition and handling capabilities – The ability to define and post failures from within API code when a user-visible problem has occurred – The ability to respond to failures posted by Revit and by API code through code in your application This also enables the creation of a modeless warning message to the user...
Every time I created a ribbon button, I was faced with the task of creating appropriately scaled icons for it to populate the
PushButton large and small image icon properties
They seem to expect a 32 x 32 and 16 x 16 icon, respectively.
I finally solved that once and for all by implementing a couple of methods to perform automatic bitmap scaling
– BitmapImageToBitmap – convert a
– BitmapToBitmapSource – convert a
Bitmap to a
– ResizeImage – resize an image to the specified width and height
– ScaledIcon – scale down large icon to desired size for Revit ribbon button
– Usage sample – putting them together...
Dragos Turmac of the Revit development team solved the Revit API discussion forum questions on contextual help not working from within a command and on F1 help for add-in only by explaining the current best practice to implement online help – Question: I'm trying to add contextual help for all commands (press F1 to go to a location). It's working fine when the tooltip is shown for my commands, but, when the add-in form is open, pressing F1 opens the Autodesk knowledge site for Revit instead...
Two recent Revit MEP related cases brought up some new information on the pipe
K factor table and custom calculations for pipe fittings, the Forge DevCon class recordings are now available, and I discovered Konrad Sobon's wonderful archi+lab Revit API blog, which helps resolve an installation and setup issue
K factor table
K factor calculation for pipe fittings
– Dynamo code to change loss coefficient
– Forge DevCon 2017 class recordings
– Revit add-in installer and buttons...
I am back from a nice break in Italy. Next, I am attending the European Autodesk University in Darmstadt, Germany. Meanwhile, solutions for two issues on keeping Revit focused and on top when working with a modeless form, and an important heads-up warning from the Revit development team on a future change coming. We here at Ideate Software are seeing what appears to be Revit add-in ownership issues with Revit's main window. The behavior has changed between Revit 2017 and Revit 2018 for modeless add-ins. For Revit 2018, when a modeless add-in is closed, Revit does not retain is focus; it is pushed behind another application...
In Revit 2018, cancelling family instance placement during a call to
PromptForFamilyInstancePlacement throws an
– Easily fixed, once discovered
– Change in Behaviour
– Exceptions Should be Exceptional
– The Building Coder samples
Today is the last day of the Forge accelerator, and I am still working on the ForgeFader project. The topics today are mainly related to Revit, though – Google prettifier on GitHub – WTA mechanical family placement add-in – Provision for void – What is a provision for void? – Creating a provision for void...
Here is a summary of the discussion and solution for setting
ActiveView during the
Idling event from the Revit API discussion forum raised and solved by Rudi 'Revitalizer' and Kinjal Desai; As per API documentation, this operation should not be invalid: no open transactions;
IsModifiable is ok;
IsReadOnly is ok; No pre-action events around. However, trying to do so throws an
InvalidOperationException with the message "Setting active view is temporarily disabled"...
Lots of information on, from and about schedule parameters, and a new elegant solution to a long-standing challenge – Direct access to shared parameter GUID – Getting parameter information from a schedule...
I continued my activity in the Revit API discussion forum and had lots of interesting discussions there. One recent thread caused me to bring up a favourite topic of mine, on keeping things simple. I'll also mention two other less recent recurring questions – Distance between two points in a specific direction – Revit command-line switches – Keeping things simple with the Revit API – Dino pondering lengthening days...
Topic: a C# .NET Revit add-in demonstrating use of a split ribbon button to access a secondary command, e.g., option settings. In the Revit API discussion forum thread on using a
StackButton as a
PushButton with options, Allan 'aksaks' Seidel recently proposed a neat UI trick, saying: Perhaps this idea might be usable for others. The
StackButton ribbon control is a stack of different
PushButton instances where the last used
PushButton remains visible to be used again. That visible button is reflected in the stack button's
CurrentButton property. Imagine if the
StackButton control always shows the first button in the stack, and the other button(s) are secondary to the first button's purpose...
Last night, I migrated The Building Coder samples to Revit 2017 – Flat Migration – Updated RvtSamples Include File – Automatic Transaction Mode is Obsolete – Obsolete Plane Constructors and NewPlane Methods – Obsolete NewPlane Method Taking a CurveArray Argument – Replace View.SetVisibility by SetCategoryHidden – Use DirectShape ApplicationId and ApplicationDataId – All Obsolete Revit API Usage Eliminated...
Today, I address the first item in yesterday's to do list
– Document and improve FireRatingClient, the stand-alone Windows client – we will need this to demonstrate the real-time BIM update from arbitrary sources
– Adding the
– Updating the
modified Field on Edit
– FireRatingClient Live BIM Update Demo Recording
– To Do...
Yesterday, I migrated RoomEditorApp to Revit 2017 and mentioned the BIM and cloud related projects I am working on. Next, let's focus on the FireRatingCloud sample. The main goal there is to implement fully automatic real-time BIM update from the cloud. Now, 24 hours after writing the previous sentence, I can tell you that I succeeded. Well, add another six hours to edit this post... Here is the updated FireRatingCloud custom ribbon tab with its new set of commands...
I have been rather busy on the Revit API discussion forum these last few days. One of the issues I got involved with was Michał Helt's thread on RibbonPanel.AddStackedItems and SplitButton, discussing how to add a split button to a ribbon panel using the AddStackedItems method. Question: Currently, Split Buttons cannot be created in the ribbon using the AddStackedItems method. Only PushButtons, PulldownButtons, ComboBoxes and TextBoxes can be added this way. Would it be possible to remove this limitation?...
I repeatedly hear from developers who wish to define a specific enumerated set of parameter values for their add-ins and limit the selection to these values in the element property palette user interface. Internally, Revit does implement a system to handle this, for instance by using negative element ids for element property drop-down list enumerations. This has also been a long-standing wish list item, and unfortunately still remains in that state, currently incorporated in the issue CF-3498 API wish: drop-down enumeration parameters for combo box...
Here is another contribution from Saied Zarrinmehr, of the BIM-SIM Research Group at the Texas A&M University, on the thread safety of the Selection.PickPoint method in Revit 2014 and 2015, resulting in a sample testing different methods for hiding and unhiding a WPF window. I trust they are interesting and useful for people working with Revit 2016 as well. Before getting to that, Calvin and Hobbes anniversary...
The issue of simple filtered element collector samples was raised in a private message. I do not like to receive private messages and avoid answering them in private. I always prefer to discuss everything I do in public and enable the entire community to contribute and share when possible. In this case, such a message led to the discussion below. I'll also point to an overview of Revit Architecture 2016 Features...
I suffer from acute and chronic responsiveness. That is unpleasant for me, although hopefully pleasing and useful for the rest of humanity. What I mean is, I tend to answer other people's questions and needs before taking care of my own. I am forever trying to stop doing that. One of these days, I certainly will. The topic I refer to above is not me, personally, though, but The Building Coder blog. Nowadays, web pages should be based on a...
Here is some exciting news from Daren Thomas on RevitLookup and the Revit Python Shell. The Python and Ruby shells came up a couple of times recently, and I also mentioned Daren's initial thoughts on making the RevitLookup snoop functionality easily accessible from within the interactive Python IDE: Curved wall elevation profile implementation in Python Live development Revit 2016 Python shell and RevitLookup incorporation Revit 2016 Ruby shell This idea has now come to fruition, and more easily than one...
Many add-in developers are interested in being notified when the current selection changes in the Revit user interface. Among other things, it led to the implementation of the selection watcher using the Idling event and was one aspect of the discussion of element level events. Checking for Selection Changes in Idling Event Handler Ken Goulding submitted a comment on that, saying: When you mentioned "Element Level", I was hoping that included element selection events, but that does not seem to...
Yesterday, we discussed a Revit add-in using .NET UI Automation to retrieve the current state of the Revit thin lines setting. Today, let's look at another application demonstrating use of that functionality to determine, list and set the Revit design options from a stand-alone executable application. Once again, this sample is presented by Revitalizer, aka Rudolf Honke of Mensch und Maschine acadGraph, who already contributed numerous other examples making use of the .NET UI Automation library to hack the Revit...
Revit add-in developers have repeatedly requested access to the Thin Lines setting provided in the Revit user interface, leading to Revit API discussion forum threads on view thin lines, exported image line weight (thin line) and rendering setting and a Revit API wish list item CF-192 – As an add-in developer, I need the API ability to detect and modify the "Thin lines" setting, so that the user can automatically get the environment configured in the way they like. Happily,...
The Revit API supports add-ins defining their own dockable panels, similar to the built-in Revit project browser and element properties panels. Here is The Building Coder topic list of Dockable Panel related discussions: What's New in the Revit 2014 API A Simpler Dockable Panel Sample RevitRubyShell for Revit 2014 Revit 2014 Update Release 1 Open MEP Connector Warning Revit 2014 Update Release 2 I have repeatedly been asked bow to host a web browser in a dockable panel, and this...
I am back from my vacation in the snow, full of new energy, and up to both ears in hot Revit API cases again instead of that frozen stuff :-) The creation document NewFamilyInstance method provides the traditional way to programmatically create a new family instance within a project, or a nested instance within a family document. It does not support any user interaction whatsoever. A little bit of user interaction is provided by the PromptForFamilyInstancePlacement method introduced in the...
Here is an interesting exploration of using UI Automation to traverse the Revit ribbon items and subscribe to an event enabling you to determine when certain commands are executed. I'll leave you to ponder this while I take a vacation in the snow next week. Happy Revit add-in programming! Question: I would like to keep track of all add-ins that are started on a given Revit installation. We currently keep track of all our own using specific routines in the...