daily pastebin goal
52%
SHARE
TWEET

GraphicsStyle Revit API

SemenG Mar 31st, 2018 (edited) 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import clr
  2. clr.AddReference("RevitServices")
  3. import RevitServices
  4. from RevitServices.Persistence import DocumentManager
  5. from RevitServices.Transactions import TransactionManager
  6. doc = DocumentManager.Instance.CurrentDBDocument
  7.  
  8. clr.AddReference('RevitAPI')
  9. import Autodesk
  10. from Autodesk.Revit.DB import *
  11.  
  12. clr.AddReference("DSCoreNodes")
  13. import DSCore
  14. clr.ImportExtensions(DSCore)
  15. from DSCore import *
  16.  
  17. lineStyles = doc.Settings.Categories.get_Item(BuiltInCategory.OST_Lines).SubCategories
  18.  
  19. for style in lineStyles: # поиск стиля по имени
  20.     if style.Name == 'Линии':
  21.         myStyle = style
  22.  
  23. lines = UnwrapElement(IN[0])
  24.  
  25. TransactionManager.Instance.TransactionTaskDone()
  26.  
  27. for line in lines: # присваивание стиля линиям
  28.     line.LineStyle = myStyle # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Not working <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  29.    
  30. TransactionManager.Instance.EnsureInTransaction(doc)
  31.  
  32. OUT = 1
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top