Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- }
Add Comment
Please, Sign In to add comment