Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import clr
- clr.AddReference('ProtoGeometry')
- from Autodesk.DesignScript.Geometry import *
- clr.AddReference("RevitAPI")
- import Autodesk
- from Autodesk.Revit.DB import *
- import System
- clr.AddReference("RevitServices")
- import RevitServices
- from RevitServices.Persistence import DocumentManager
- from RevitServices.Transactions import TransactionManager
- clr.AddReference("RevitNodes")
- import Revit
- clr.ImportExtensions(Revit.Elements)
- clr.ImportExtensions(Revit.GeometryConversion)
- clr.AddReference("DSCoreNodes")
- import DSCore
- from DSCore import *
- clr.AddReference("System")
- from System.Collections.Generic import *
- import math
- doc = DocumentManager.Instance.CurrentDBDocument
- ListaElementow = UnwrapElement(IN[0])
- ListaParametrow = [
- BuiltInParameter.OPTION_SET_ID, # "Design Option Set Id"
- BuiltInParameter.OPTION_NAME, # "Name"
- BuiltInParameter.PRIMARY_OPTION_ID, # "Primary Option Id"
- BuiltInParameter.OPTION_SET_NAME, # "Name"
- BuiltInParameter.DESIGN_OPTION_ID, # "Design Option" +
- BuiltInParameter.DESIGN_OPTION_PARAM, # "Design Option" +
- ]
- ListaElementow2 = []
- for i in ListaElementow:
- ListaElementow2.append(i)
- #
- Opcja = i.DesignOption
- OpcjaSTR = ""
- if Opcja == None:
- OpcjaSTR = "Main Model"
- else:
- pass
- DaneWyjsciowe = []
- for i, indeks1 in zip(ListaElementow, range(len(ListaElementow))):
- print("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++")
- DaneWyjsciowe.append([])
- for j, indeks2 in zip(ListaParametrow, range(len(ListaParametrow))):
- DaneWyjsciowe[indeks1].append([])
- try:
- A = str(j) + ": " + str(i.get_Parameter(j).AsDouble())
- print(A)
- DaneWyjsciowe[indeks1][indeks2].append(A)
- except:
- A = str(j) + ": AsDouble() Błąd"
- print(A)
- DaneWyjsciowe[indeks1][indeks2].append(A)
- #
- try:
- B = str(j) + ": " + str(i.get_Parameter(j).AsElementId())
- print(B)
- DaneWyjsciowe[indeks1][indeks2].append(B)
- except:
- B = str(j) + ": AsElementId() Błąd"
- print(B)
- DaneWyjsciowe[indeks1][indeks2].append(B)
- #
- try:
- C = str(j) + ": " + str(i.get_Parameter(j).AsInteger())
- print(C)
- DaneWyjsciowe[indeks1][indeks2].append(C)
- except:
- C = str(j) + ": AsInteger() Błąd"
- print(C)
- DaneWyjsciowe[indeks1][indeks2].append(C)
- #
- try:
- D = ""
- if i == None:
- D = str(j) + ": " + "Main Model"
- else:
- D = str(j) + ": " + str(i.get_Parameter(j).AsString())
- print(D)
- DaneWyjsciowe[indeks1][indeks2].append(D)
- except:
- D = str(j) + ": AsString() Błąd"
- print(D)
- DaneWyjsciowe[indeks1][indeks2].append(D)
- #
- try:
- E = str(j) + ": " + str(i.get_Parameter(j).AsValueString())
- print(E)
- DaneWyjsciowe[indeks1][indeks2].append(E)
- except:
- E = str(j) + ": AsValueString() Błąd"
- print(E)
- DaneWyjsciowe[indeks1][indeks2].append(E)
- #
- print("---------------------------------------------------")
- #Assign your output to the OUT variable.
- OUT = DaneWyjsciowe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement