daily pastebin goal
33%
SHARE
TWEET

Untitled

a guest Apr 4th, 2018 69 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. paths = UnwrapElement(IN[0])
  18.  
  19. categories = doc.Settings.Categories # получаем все категории
  20. lineCat = categories.get_Item(BuiltInCategory.OST_Lines )  # из всех категорий выбираем категорию линий (о чем свидетельствует OST_Lines)
  21. lineTypes = lineCat.SubCategories # Все стили линий лежат в так называемой субкатегории, можно убедиться и вывести их имена OUT =  [i.Name for i in lineStyleSubTypes]
  22.  
  23. for i in lineTypes:
  24.     if i.Name == 'ADSK_Сплошная_Красная_3':
  25.         myStyle = i
  26.  
  27. TransactionManager.Instance.TransactionTaskDone()
  28.  
  29. list = []
  30. for path in paths:
  31.     sublist = []
  32.     for line in path:
  33.         #line.LookupParameter('Стиль линий').Set(33)
  34.         #line.LineStyle = myStyle
  35.         sublist.append(line.LineStyle)
  36.         #LookupParameter('Стиль линий').AsValueString())
  37.     list.append(sublist)
  38.  
  39. TransactionManager.Instance.EnsureInTransaction(doc)
  40.  
  41. OUT = myStyle, list
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