Created
January 14, 2011 00:34
-
-
Save pzurek/778928 to your computer and use it in GitHub Desktop.
A simple workaround for a problem with Revit 2011 API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void updateReferencingSheet(Document doc) | |
{ | |
// Retrieve the built-in VIEW_DISCIPLINE parameter | |
Parameter discipline = selectedViewport | |
.get_Parameter(BuiltInParameter.VIEW_DISCIPLINE); | |
// Save the value of that parameter for later | |
int disciplineNo = discipline.AsInteger(); | |
Transaction transaction = new Transaction(doc); | |
transaction.Start("Updating the model"); | |
// If the parameter value is set to 1 change it to 2 | |
// if it's set to anything else change it to 1 | |
discipline.Set(1 == disciplineNo ? 2 : 1); | |
// Now change it back to the previously saved value | |
discipline.Set(disciplineNo); | |
transaction.Commit(); | |
// Voila! Your "Referencing Sheet" parameter is up to date | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment