We continue updating all systems the new release and take a deep dive into the mysteries and pitfalls of the Failure API – RevitApiDocs support for Revit 2023 – Migrating add-ins to Revit 2023 – Disable failure with error severity... Read more →
We continue updating all systems the new release and take a deep dive into the mysteries and pitfalls of the Failure API – RevitApiDocs support for Revit 2023 – Migrating add-ins to Revit 2023 – Disable failure with error severity... Read more →
Posted on May 09, 2022 at 11:00 in 2023, Deletion, Docs, Failure, Migration, Transaction | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
The most exciting RevitLookup enhancement in its entire history, yet another need for regeneration and a great new option for your personal safety – Modeless RevitLookup – Need for regen for read-only parameter – Structural bridge design – Outdoor seatbelt... Read more →
Posted on October 26, 2021 at 11:00 in Fun, Modeless, Parameters, Regen, RevitLookup, Transaction | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
You should always keep things simple (I think).
The opposite can lead to racking your brain.
In one case at least, that can easily be avoided by using a using
statement
– Avoid brain racking by using using
– On the VS operation unspecified error
– Native sons...
Read more →
Posted on October 12, 2020 at 11:00 in .NET, Debugging, Music, Philosophy, Transaction | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
Lukáš Kohout brought up an interesting and important issue on changing material texture path with EditScope
– How to set the material texture path?
– Suggestions
– Solution and sample material
– ChangeRenderingTexturePath
method
– Step by step guide
– Test run...
Read more →
Posted on April 02, 2019 at 11:00 in 2018, Data Access, Element Creation, Material, Transaction | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
We have looked at numerous different approaches to determine wall openings in the past, so it seems pretty hard to nail down, and pretty important to solve.
Now Håvard Leding of Symetri contributed yet another exciting idea which highlights a number of surprising aspects,
demonstrates a further creative use case for GetDependentElements
and expands on his
recent RevitLookup enhancement to retrieve and snoop dependent elements
– Get demolished solid
– Why?
– Questions...
Read more →
Posted on March 28, 2019 at 11:00 in Algorithm, Data Access, Dimensioning, Element Relationships, Geometry, Transaction | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
We return to
the question on how
to combine multiple transactions into one undo with a new answer by Arnošt Löbel, ex Senior Principal Engineer of the Revit development team
– How do I know how many transactions, and which ones, are assimilated into group?
– What if I start a transaction before starting a group (in the same API context) and then call Assimilate
, will this ahead started one also be assimilated into the group?
– I can leave the API context (external event or Execute
method) with the transaction group still open...
Read more →
Posted on November 10, 2018 at 11:00 in Events, External, Group, Transaction | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
Joshua Lumley pointed out the recording he made for his BILT submission on five secrets of Revit API C# coding. Before getting to that, here are a couple of pictures from this last weekend's mountain tour – Ruessigrat, Brotmesser and Matthorn – Five secrets of Revit API Coding... Read more →
Posted on September 10, 2018 at 11:00 in .NET, Climbing, Events, External, Getting Started, Macro, Modeless, Philosophy, Photo, Transaction | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
Today, we revisit the interesting and generic question on retrieving all exterior walls. That may be easy in a perfect and complete model. However, it raises some challenges in an incomplete BIM – Retrieving all exterior walls – Several possible approaches – Using a computational geometry approach – Manually adding the huge surrounding room – Encapsulate transactions and roll back instead of deleting – Determining model extents via wall bounding box – Implementing the huge surrounding room approach – Retrieving family instances satisfying a filter rule... Read more →
Posted on May 24, 2018 at 11:00 in Algorithm, Filters, Geometry, Transaction | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
I listed several possible approaches to trigger a refresh of an element's graphics display. Here is another one: Applying element rotation to adjust and fix conduit end... Read more →
Posted on February 02, 2018 at 11:00 in Element Creation, Geometry, Regen, Transaction, Update | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
We discussed several examples of using the temporary transaction trick TTT in the past. Here is a new exquisitly subtle variant for you to enjoy, provided by Frank @Fair59 Aarssen to get the coordinates of the endpoints for a section marker line segment. Question: I have a section marker that I would like to rotate around one of the endpoints of the line segment leader, but I haven't been able to figure out how to determine the endpoint coordinates... Read more →
Posted on March 20, 2017 at 11:00 in Data Access, Geometry, Transaction, View | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
Lots of exciting news for today, like every day, once again on the pure Revit API, connecting the desktop and the cloud, and Autodesk Forge – Isolating an element in a newly created view requires two transactions – Forge research enquiry – Connecting desktop and cloud – Roomedit3dv3 live – Could you demo this remotely? – Connecting desktop and cloud draft handout – Table of contents... Read more →
Posted on October 06, 2016 at 11:00 in 360, Accelerator, AU, BIM, Cloud, Data Access, Desktop, DevDays, Forge, Regen, Transaction, Viewer | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
I made my choice on the starting point for the new roomedit3d
incarnation, and the second Forge webinar was successfully held
– The birth of Roomedit3dv3
– Forge webinar session 2 on OAuth and the Data Management API...
Read more →
Posted on September 24, 2016 at 11:00 in 360, Accelerator, Cloud, Events, Forge, Getting Started, Hackathon, Transaction, Viewer | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
Today we have two ever-recurring topics to revisit: a discussion on how to react to a document modification and yet another example of the need for regeneration – Idling and external events, DMU and DocumentChanged – Need for regen in an updater... Read more →
Posted on January 12, 2016 at 11:00 in Deletion, DMU, Events, External, Idling, Performance, Regen, Transaction, Update | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
Autodesk University is already nearing its end. It went by so fast! I attended a bunch of brilliant classes, took notes during Cyrille Fauvel's cloud and mobile expert panel, and successfully presented my own two, the Revit API expert panel and connecting desktop and cloud. That led to a completely different topic – SpatialElementGeometryCalculator bug fix – do not delete while iterating – SpatialElementGeometryCalculator migration to Revit 2016 – IoC, the Internet of Cows – Two nice Iain Banks Quarry quotes... Read more →
Posted on December 04, 2015 at 01:00 in Algorithm, AU, Element Relationships, Filters, Migration, Transaction, Update | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
The first day at Autodesk University was jam-packed full and exciting as always. My main highlights were – The Keynote session – The DevHack – Arnošt Löbel's class SD10752 on Revit External Services – The Revit API panel... Read more →
Posted on December 02, 2015 at 03:00 in AU, Events, News, Photo, SDK Samples, Transaction | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
Revit API discussion forum threads – Geometry basics: how to retrieve geometry without prompting the user? – No modifying linked files: you have to unlink... Read more →
Posted on September 09, 2015 at 11:00 in Geometry, Getting Started, Links, Transaction | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
Lots of topics from Revit API discussion forum threads and GitHub updates: Family category; Keeping track of elements; Undoing a transaction; RevitLookup, GetRevisionData and ADN Revit API Training Labs update... Read more →
Posted on September 03, 2015 at 11:00 in 2015, Element Relationships, Family, RevitLookup, SDK Samples, Training, Transaction, Update, VB | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
Today, let's talk about the life span of Revit geometry and accessing the IFC GUID of an imported element: Life span and cloning of solids and faces Accessing the IFC GUID of an imported wall First, I'll just mention that I returned safe and sound from the successful fourth and last day of the Milano WebGL workshop, which we concluded with a group session guiding through the View and Data API tutorial. I wrote is a short report on that... Read more →
Posted on June 30, 2015 at 11:00 in Geometry, IFC, Parameters, Photo, Transaction, Travel | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
Today, I can present the explanation and prophylactic measure required to prevent a problem of sheets missing from print dialogue. It was only occasionally reported, and I finally heard about the fact and its resolution last week. In brief, when creating sheets programmatically, only create one sheet per transaction! Before looking at that in more detail, I'll just mention that the Revit 2016 service pack 1 was automatically installed for me when I started up Revit today. First of all,... Read more →
Posted on June 01, 2015 at 11:00 in 2016, Debugging, Photo, Print, Settings, Transaction, Update | Permalink | 0 Comments
Tags: akn_include, Jeremy Tammik, Revit API
Determination of gross and net areas and volumes is fundamental to BIM. Here is an interesting solution to determine the gross and net area of a wall, i.e. with and without its openings, making use of the SpatialElementGeometryCalculator and the temporary transaction trick. The question was raised and solved by Phillip Miller of Kiwi Codes Solutions Ltd, starting with the Revit API discussion forum thread on door/window areas: Question: I need to determine the cut areas of windows and doors... Read more →
Posted on March 17, 2015 at 11:00 in Algorithm, gbXML, Geometry, Migration, Parameters, Transaction, VB | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
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... Read more →
Posted on March 02, 2015 at 11:00 in 2015, Element Creation, Family, Git, Transaction, User Interface, VB | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
We repeatedly discussed the optimal usage and error handling of transactions, mainly based on the expert advice of Arnošt Löbel, Sr. Principal Engineer of the Autodesk Revit R&D team: Scope and Dispose of Transactions Using Using Automagically Disposes and Rolls Back Handling Transaction Status and Errors Let's complete this with his most recent advice on handling transaction groups to combine multiple transactions into one undo: Question: I am creating an application that must do the following steps: Load a FamilySymbol... Read more →
Posted on February 11, 2015 at 11:00 in Git, Group, Migration, Transaction, Update | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Today, let's discuss how to handle transaction status and errors, quickly, before Autodesk University and my stint of DevDays conferences begins on Monday. I also briefly touch on programmatic file upload to A360, my arrival in Las Vegas and current reading. By the way, this is a special post for me, being the number 1250. In the olden days, every new century of posts was important... now it is five quarters of a millennium. So I have something to celebrate... Read more →
Posted on November 29, 2014 at 11:00 in .NET, 360, Glue, Transaction, Travel | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Wow, hark these cool topics for today: Autodesk Cloud Accelerator workshop invitation BIM becomes VDC Using Transaction Groups to Relinquish Elements Without Saving or Syncing Autodesk Cloud Accelerator Workshop Invitation Autodesk just announced the 2015 Autodesk Cloud Accelerator, a two-week workshop in March 2015 in our San Francisco office for up to 14 creative software developers. For two weeks, March 9 to March 20, 2015, participants will work intensively on their chosen project with the help, support, and training of... Read more →
Posted on November 20, 2014 at 11:00 in BIM, Cloud, Getting Started, Training, Transaction, VDC, Workset | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Here is an interesting case with a simple solution that was rather hard to discover. In summary, you need to ensure that all family symbols are activated before making use of them. Question: I'm having a strange problem when replacing curtain walls by windows in Revit 2014. When I run my add-in command, all the curtain walls are successfully replaced by the window family instances. All except the first also cut the hosting wall in the proper manner. The first... Read more →
Posted on August 12, 2014 at 11:00 in Debugging, Element Creation, Family, Regen, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
I talked about how to refresh element graphics display back in 2011, and it seems like the time has come to revisit that topic. After that, I also want to mention an approach to determine the height of a schedule in a sheet and how to avoid running a web server. Refresh Element Graphics Display Afshin just submitted a comment about this on replacing an Idling event handler by an external event, and another developer asked something similar today, so... Read more →
Posted on June 26, 2014 at 11:00 in Algorithm, JavaScript, Regen, Schedule, Transaction, View | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Here are some of the non-confidential items from the new confidential April 17 Autodesk Developer News newsletter, plus one or two additional items of interest from myself and elsewhere: AEC Technology Symposium Migrate Autodesk Exchange Apps and publish 2015 versions Proposals for Autodesk University 2014 Proposals for Autodesk University Germany 2014 Autodesk ReCap Connect Partnership Program RevitLookup for Revit 2015 UR1 Happy Easter! AEC Technology Symposium I already pointed out the upcoming AEC Technology Symposium in New York City on... Read more →
Posted on April 18, 2014 at 11:00 in AU, Git, Hackathon, News, ReCap, RevitLookup, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
We looked at a nice example of using Boolean operations and InstanceVoidCutUtils back in the year 2011, cutting out part of a beam using a void cutter family. I tried to make use of this again in a recent Revit API training and was somewhat shocked to discover that it did not work as expected. I checked all the prerequisites were fulfilled. Void Cutter Family First of all, the void cutter family must have its 'Cut with Voids When Loaded'... Read more →
Posted on April 10, 2014 at 11:00 in Element Relationships, Family, Git, Regen, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Once upon a time, while teaching a Revit API class, the training participants identified a problem that was simple enough to be used as a filtered element collector learning example and did something useful at the same time: deleting reference planes not hosting any elements, implemented as the stand-alone external command DeleteUnnamedNonHostingReferencePlanes. It deletes all reference planes that have not been named and are not hosting any elements. Here is another thread discussing filtering reference planes and explaining the use... Read more →
Posted on February 04, 2014 at 11:00 in 2014, Deletion, Filters, Git, Migration, Parameters, Transaction, Utilities | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
The topic of CNC fabrication of Revit BIM elements is continuing to grow in popularity. As you already know, I published the ExportWallboard add-in to automatically isolate and export wall parts individually to DXF for CNC fabrication, then enhanced, renamed and published it on GitHub as ExportCncFab for William Spier's Autodesk University class on Design to Fabrication. Those discussions were explicitly related to CNC fabrication up front. Numerous other topics here are also useful in that context. I was unable... Read more →
Posted on December 19, 2013 at 11:00 in DXF, Fun, Git, Parts, SAT, Transaction, Utilities | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
One topic brought up at Scott Conover's worksharing roundtable was the question of how to save a new Revit central file to a Revit Server. Participants even questioned whether this is possible at all with the current API. Well, it is, and we look at the exact steps to achieve that below as well as: DevDay in Farnborough, cabs and flights Saving a new central file to Revit Server Consistent naming of transactions and transaction groups Changing the category of... Read more →
Posted on December 12, 2013 at 11:00 in 2014, Family, Server, Transaction, Travel, Workset | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
I am in a hurry, still not finding time to prepare my AU classes, and lots going on. I published an add-in named ExportWallboard to automatically isolate and export wall parts individually to DXF for CNC fabrication back in March, still for Revit 2013, at the time. That utility is in use, was renamed to ExportCncFab and has enjoyed some further enhancement since, such as: Support for export to SAT as well as DXF A beautiful little external application to... Read more →
Posted on October 25, 2013 at 11:00 in 2014, DXF, Export, Git, Migration, Parts, RevitLookup, SAT, Transaction, Utilities | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Today, we continue yesterday's discussion on the need to handle your own exceptions and mention Joe Ye's solution to edit an existing slab boundary. How to Handle Your Own Exceptions Yesterday we explained why Revit cannot gracefully handle all your exceptions for you and the need to do so yourself in all parts of your Revit add-in, especially the modeless ones that Revit is not even aware of. Better still, of course, is to avoid all modeless activity completely, if... Read more →
Posted on October 10, 2013 at 11:00 in .NET, Algorithm, Data Access, Debugging, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Here is a recent query from a developer that led to a nice succinct overview of transactions, sub-transactions and transaction groups by Arnošt Löbel. This makes a change from the recent rash of monster posts. The last ten posts were all rather overwhelming in size, and hopefully impressive in content as well. From Aril 16 until 29, I posted a total of 26228 words, 245504 bytes. So let's keep this one short, sweet and to the point. Question: When should... Read more →
Posted on April 30, 2013 at 11:00 in Getting Started, Group, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
I am back from my vacation. It was a wonderful break, and I feel ready and happy to get back to grips with everyday life and work again. A query from a colleague caught up with me already on the way back, on exporting a whole bunch of selected wall panel parts to individual DXF files. That gave me something nice and interesting to fiddle with during the nightly train ride up from Napoli to Milano and led to the... Read more →
Posted on March 11, 2013 at 11:00 in Events, External, Parts, Photo, Transaction, Travel | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Whenever your add-in modifies the model in any way and you wish to query the Revit database, you need to pay careful attention to ensure that you do not retrieve stale or invalid data. If anything unexpected whatsoever happens, one of the first things to consider is the possible need for a document regeneration or additional separate transactions between steps. These kinds of issues arise frequently. I discussed adding an extra transaction to modify beam parameters and add openings to... Read more →
Posted on December 03, 2012 at 11:00 in AU, Data Access, Element Creation, Regen, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Thursday was another very full and fruitful day at AU. I gave my third and last class, the most exciting one in my eyes, on some UI and integration aspects. I was unable to attend Iffat May's class introducing Python and using it in Revit and Vasari via RevitPythonShell, but I love her material so much I am including it anyway. Adam Nagy presented a class addressing cloud and mobile development and the Revit Server API. Finally, Arnošt Löbel provided... Read more →
Posted on November 30, 2012 at 16:00 in 2013, AU, Cloud, Events, Idling, Python, Server, Transaction, User Interface, Vasari, View, Win32 | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
I mentioned a number of uses of the temporary transaction trick a few days back. Autodesk's own Revit API transaction expert Arnošt Löbel has a very important point to add to that discussion: The procedure as described is not always going to work. First of all, you need to regenerate manually before retrieving any modified geometry; even that is not always guaranteed to give you the accurate and proper geometry. Many times you will need to actually commit the 'temporary'... Read more →
Posted on November 02, 2012 at 11:00 in Data Access, Geometry, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Last week I provided an updated version of the CmdSlabBoundary external command to determine a floor slab boundary. Here is a follow-up to that issue: Question: The solution provided to retrieve the slab boundary works fine for me if no openings are cut out. I have a situation where my slabs are cut by openings, however, and I need to retrieve the original uncut gross slab boundary. Here is an example with two slabs A and B and an opening... Read more →
Posted on October 30, 2012 at 11:00 in Algorithm, AU, Data Access, Events, Geometry, News, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
In the far distant past, I looked at various ways to programmatically determine relationships between associated objects (also in VB), including references between a host object and its hosted dependent elements, e.g. determining the relationship between a wall and its footing. That was back in the year 2009, using Revit 2010. A few things have changed and been added since then, but the more things change, the more they stay the same, don't they? Anyway, this very question was raised... Read more →
Posted on October 08, 2012 at 11:00 in 2013, Element Relationships, Migration, RST, Transaction | Permalink | 0 Comments | TrackBack (0)
Another one of those recurring questions: how to create dimensioning. I took the opportunity to highlight how to search the samples, find a solution, and apply a correction to RevitLookup yourself. You have the code. May the Force be with you. Question: I tried to create detail drawings programmatically using the ItemFactoryBase NewDimension method. I am creating detail lines in the drafting view based the on the geometry wall elements and would like to use Revit dimensioning to insert measurements... Read more →
Posted on September 28, 2012 at 11:00 in Element Creation, Family, Getting Started, SDK Samples, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
KR raised a very valid and important question in the discussion of exporting parameters to Excel: Question: It would be great if you could clarify in broad terms when to dispose of Revit API objects. You underline the importance of disposing of Transaction objects. Many objects in the Revit API implement IDisposable, for example FilteredElementCollector, DB.Document, etc. If I create a new FilteredElementCollector within the confines of Revit API, e.g. in an external command, Idling event handler, external event etc.,... Read more →
Posted on September 25, 2012 at 11:00 in .NET, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Here is a question that we have looked at in the distant past, brought up again and reinforced by Jon Mirtschin of Geometry Gym, working on BIM and model exchange with Rhino, Grasshopper et al: Question: Sorry to bother you, but trying to get a quick answer to this problem. If you happen to have 5 minutes to help, it will be greatly appreciated. I've attached a sample Revit project. It simply creates a polyline curve array and slab outline,... Read more →
Posted on July 13, 2012 at 11:00 in Element Creation, Regen, SDK Samples, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
We have been discussing transactions and their disposal quite a bit recently, with lots of interesting input from Guy Robinson and Arnošt Löbel. They just submitted comments on EditFamily requiring a non-modifiable document which highlight another issue in this area worthwhile promoting to a post of its own to ensure that you take notice: Guy says: ... maybe it's time to recommend using the Manual transaction mode only and the removal of Automatic mode. This would pave the way for... Read more →
Posted on May 03, 2012 at 11:00 in Data Access, Element Creation, Migration, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
I recently received a note from Matt Mason pointing out that the behaviour of the EditFamily method changed in Revit 2013, and a suggestion to highlight this fact. The suggestion is very valid, since his note was quickly followed up by a matching question by Woong Ki Sung on reloading a family, who ran into the very same issue: Question: I am testing some code to edit family types in Revit 2013, and I have a transaction problem even though... Read more →
Posted on May 01, 2012 at 11:00 in 2013, Family, Migration, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
I talked about scoping and disposing of transactions last week, and received prompt and interesting comments from two competent and experienced Revit add-in developers, Danny Polkinhorn and Guy Robinson (your name has to end in 'y' to be really good – tongue in cheek). Danny says: Should we also use Try...Catch blocks as well? using( Transaction trans = new Transaction( doc ) ) { try { trans.Start(); //code here trans.Commit(); } catch( Exception ex ) { trans.RollBack(); //exception code here... Read more →
Posted on April 24, 2012 at 11:00 in .NET, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Arnošt Löbel added an important comment on the sample code that I published for refreshing a view: It is for the best if all transaction objects are always properly scoped, e.g. within a C# 'using' block. This includes transactions, sub-transactions, transaction groups, and other scope-like objects such as StairsEditScope. Not doing so can yield some pretty weird situations when exceptions come into play. In your example, proper scoping can be implemented by adding 'using' statements, which automatically dispose of the... Read more →
Posted on April 18, 2012 at 11:00 in Regen, Transaction, Update, User Interface | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Here is yet another interesting example of an apparent gap in the Revit API that can be easily filled using a little workaround. We have seen numerous examples of performing a certain operation within a temporary transaction that is then rolled back to cancel it, such as to determine gross material quantities for an element with openings, a host reference and, more generally, all object relationships. Here is an example of using a related but different approach: the trick consists... Read more →
Posted on March 19, 2012 at 10:00 in Algorithm, Data Access, Failure, Installation, Settings, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
The advice to 'avoid Idling' may sound rather puritanical and a bit on the workaholic side, but I pay it special heed since it comes from Arnošt Löbel, Sr. Principal Engineer in the Revit development team, our resident Revit Idling expert, who already provided many (or almost all?) important insights in this and other related areas: Transaction responsibility Regeneration option best practices Asynchronous API calls and Idling AutoJoinElements Closing the active document and why not to Modeless door lister flaws... Read more →
Posted on January 11, 2012 at 11:00 in 2012, Algorithm, AU 2011, DMU, Events, Idling, Transaction | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API
Today is the second day of AU for me, the first 'real' day of the conference. I woke up at two in the morning, got back to sleep again eventually, but gave up at five and thus had plenty of time for a final private dress rehearsal for my lecture on the extensible storage API later today. I needed that, since it is a couple of weeks since I submitted the material and all but forgot what it is about... Read more →
Posted on November 29, 2011 at 20:00 in Element Creation, Transaction, User Interface | Permalink | 0 Comments | TrackBack (0)
Tags: Jeremy Tammik, Revit API