Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. import clr
  2. clr.AddReference('ProtoGeometry')
  3. from Autodesk.DesignScript.Geometry import *
  4.  
  5. clr.AddReference("RevitAPI")
  6. import Autodesk
  7. from Autodesk.Revit.DB import *
  8. import System
  9.  
  10. clr.AddReference("RevitServices")
  11. import RevitServices
  12. from RevitServices.Persistence import DocumentManager
  13. from RevitServices.Transactions import TransactionManager
  14.  
  15. clr.AddReference("RevitNodes")
  16. import Revit
  17. clr.ImportExtensions(Revit.Elements)
  18. clr.ImportExtensions(Revit.GeometryConversion)
  19.  
  20. clr.AddReference("DSCoreNodes")
  21. import DSCore
  22. from DSCore import *
  23.  
  24. clr.AddReference("System")
  25. from System.Collections.Generic import *
  26.  
  27. import math
  28.  
  29. doc = DocumentManager.Instance.CurrentDBDocument
  30.  
  31. ListaElementow = UnwrapElement(IN[0])
  32.  
  33. ListaParametrow = [
  34. BuiltInParameter.OPTION_SET_ID, # "Design Option Set Id"
  35. BuiltInParameter.OPTION_NAME, # "Name"
  36. BuiltInParameter.PRIMARY_OPTION_ID, # "Primary Option Id"
  37. BuiltInParameter.OPTION_SET_NAME, # "Name"
  38. BuiltInParameter.DESIGN_OPTION_ID, # "Design Option" +
  39. BuiltInParameter.DESIGN_OPTION_PARAM, # "Design Option" +
  40. ]
  41. ListaElementow2 = []
  42. for i in ListaElementow:
  43. ListaElementow2.append(i)
  44. #
  45. Opcja = i.DesignOption
  46. OpcjaSTR = ""
  47. if Opcja == None:
  48. OpcjaSTR = "Main Model"
  49. else:
  50. pass
  51.  
  52. DaneWyjsciowe = []
  53. for i, indeks1 in zip(ListaElementow, range(len(ListaElementow))):
  54. print("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
  55. DaneWyjsciowe.append([])
  56. for j, indeks2 in zip(ListaParametrow, range(len(ListaParametrow))):
  57. DaneWyjsciowe[indeks1].append([])
  58. try:
  59. A = str(j) + ": " + str(i.get_Parameter(j).AsDouble())
  60. print(A)
  61. DaneWyjsciowe[indeks1][indeks2].append(A)
  62. except:
  63. A = str(j) + ": AsDouble() Błąd"
  64. print(A)
  65. DaneWyjsciowe[indeks1][indeks2].append(A)
  66. #
  67. try:
  68. B = str(j) + ": " + str(i.get_Parameter(j).AsElementId())
  69. print(B)
  70. DaneWyjsciowe[indeks1][indeks2].append(B)
  71. except:
  72. B = str(j) + ": AsElementId() Błąd"
  73. print(B)
  74. DaneWyjsciowe[indeks1][indeks2].append(B)
  75. #
  76. try:
  77. C = str(j) + ": " + str(i.get_Parameter(j).AsInteger())
  78. print(C)
  79. DaneWyjsciowe[indeks1][indeks2].append(C)
  80. except:
  81. C = str(j) + ": AsInteger() Błąd"
  82. print(C)
  83. DaneWyjsciowe[indeks1][indeks2].append(C)
  84. #
  85. try:
  86. D = ""
  87. if i == None:
  88. D = str(j) + ": " + "Main Model"
  89. else:
  90. D = str(j) + ": " + str(i.get_Parameter(j).AsString())
  91. print(D)
  92. DaneWyjsciowe[indeks1][indeks2].append(D)
  93. except:
  94. D = str(j) + ": AsString() Błąd"
  95. print(D)
  96. DaneWyjsciowe[indeks1][indeks2].append(D)
  97. #
  98. try:
  99. E = str(j) + ": " + str(i.get_Parameter(j).AsValueString())
  100. print(E)
  101. DaneWyjsciowe[indeks1][indeks2].append(E)
  102. except:
  103. E = str(j) + ": AsValueString() Błąd"
  104. print(E)
  105. DaneWyjsciowe[indeks1][indeks2].append(E)
  106. #
  107. print("---------------------------------------------------")
  108.  
  109. #Assign your output to the OUT variable.
  110. OUT = DaneWyjsciowe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement