Revit API 2012 provides a new Performance Advisor Rule API with which we can access to all the existing native Revit peformance advisor rules, execuate any of them, and create our own ones when necessary and hook them up into the system.
When creating our Performance Advisor Rules, we may want to brand them so that we can put all those native ones aside and call only our owns up when necessary. However, the Revit API 2012 does not provide us a straightforward way to distinguish native Performance Advisor Rules (PerformanceAdviserRule) and custom ones.
The current situation is that when some custom Performance Advisor Rules have been created and hooked up into the system they are all mixed up with those native ones in the PerformanceAdviser and all rules will be returned by the GetAllRuleIds() call.
We introduced an easy and tuitive approach previously to brand our own Performance Advisor Rules (PerformanceAdviserRule) as such, using a group of digits/letters as your brand in the second group of the GUID. For example, for the brank ABCD, some GUIDs will look like:
71B923D4-ABCD-4BE4-861A-3A26146EF3F0
398A60AB-ABCD-48C1-ADEA-70009C3DFAC9
031E215A-ABCD-4AB1-9D73-2C52872DA802
However, it raises an issue. Since GUID characters can only have digits and ABCDEF besides the hyphen dimimiters, how can we interpret all possible brand abbriviations with these limited resources?
For example, for our Revit (.NET) Addin Wizard brand, we generally abbreviate it as RAW or RNAW. How can we use it in the second group of the GUID strings then?
Don’t worry. Here is another suggestion, using the following table:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
a b c d e f g h i j k l m n o p q r s t u v w x y z
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9
So, for our RAW, we can use the 1A6 and a suffix 0 to make it 1A60; or for RNAW, we use 17A6. So the three sample GUIDs will become as:
71B923D4-17A6-4BE4-861A-3A26146EF3F0
398A60AB-17A6-48C1-ADEA-70009C3DFAC9
031E215A-17A6-4AB1-9D73-2C52872DA802
How does this sound?
If it sounds good, please feel free to keep the encipher/decipher table for reference in the future. Enjoy it!
Revit Addin Wizard (RevitAddinWizard) provides a PerformanceAdvisor Rule Creator to help implement custom performance advisor rules automatically and quickly. RevitAddinWizard can be downloaded from the Download link at the bottom of the blog index page.
Recent Comments