Regeneration control in Revit API seemed a very hot topic in the past and many sides were involved in discussions, suggestions, and decisions regarding whether it is necessary to control regenerations, what options should be provided, which option should be defaulted, how to exercise the control over various model operations, and so on.
In terms of the specific Regeneration attribute and the RegenerationOption enumeration, there were a lot of arguments too. One side strongly requested the Automatic RegenerationOption to be removed and only the Manual option should be used mainly for performance and consistency considerations; another side wanted the Automatic option to be kept and did not really care about other options for simplicity and compatibility purposes.
Parties dealing with both just swung from side to side. Judges had to make a decision anyway and finally decided to remove the Automatic RegenerationOption.
So now in Revit API 2012, though there is one and only one RegenerationOption available, the Manual option specifically, the RegenerationOption enumeration is still kept in the API. So a likely use of the Regeneration attribute and the RegenerationOption enumeration in the Revit 2012 addins looks like the following:
[Transaction(TransactionMode.Manual)]
[Regeneration(RegenerationOption.Manual)]
public class ExtCmd : IExternalCommand
{
What is the real difference from 2011 then?
If people try to find any other options for the 2012 version RegenerationOption with either intellisense or Visual Studio Object Model, they will be disappointed because none at all.
Why it that?
Maybe it will be easier to roll back to the previous behavior (both Automatic and Manual RegenerationOption options are available for people to choose what they like depending on their different and particular needs)? Not so sure!
If nothing really big from Revit internal prevents the Automatic RegenerationOption from being continually supported, then personally I would question why the nice Automatic option must be removed.
It may bring up a broader topic, Automation and Performance and Which One is More Important. More automation may sacrifice some performance; and to make performance perfect maybe people really have to do everything manually and pay attention to very detail by themselves. The thing is that people are different and even for the same single person her need is different and/or her nature changes along the time!
If vendors are not so sure about it (many times it may just be true), providing more options for customers to choose is apparently not a bad idea, rather than one at a time to make some happy (and some not) and another at a different time to happy those previously unhappy but unhappy those old happy people. It seems off topic so we stop here.
The good thing (maybe not) is that the whole Regeneration attribute becomes optional now. So the following use (skipping the Regeneration attribute) is fine too:
[Transaction(TransactionMode.Automatic)]
// [Regeneration(RegenerationOption.Manual)]
public class ExtCmd : IExternalCommand
{
It looks pretty natural since the Regeneration attribute only accepts the RegenerationOption enumeration and the RegenerationOption enumeration only has a single value, Manual now. Not sure if it is a feature though of programming languages such as C# here.
The Revit Addin Wizard (RevitAddinWizard) will exercise the first approach for 2012 version addin projects for the same flexibility purpose.
Recent Comments