Guest User

Untitled

a guest
Jul 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. void updateReferencingSheet(Document doc)
  2. {
  3. // Retrieve the built-in VIEW_DISCIPLINE parameter
  4. Parameter discipline = selectedViewport
  5. .get_Parameter(BuiltInParameter.VIEW_DISCIPLINE);
  6.  
  7. // Save the value of that parameter for later
  8. int disciplineNo = discipline.AsInteger();
  9.  
  10. Transaction transaction = new Transaction(doc);
  11. transaction.Start("Updating the model");
  12.  
  13. // If the parameter value is set to 1 change it to 2
  14. // if it's set to anything else change it to 1
  15. discipline.Set(1 == disciplineNo ? 2 : 1);
  16.  
  17. // Now change it back to the previously saved value
  18. discipline.Set(disciplineNo);
  19. transaction.Commit();
  20.  
  21. // Voila! Your "Referencing Sheet" parameter is up to date
  22. }
Add Comment
Please, Sign In to add comment