Запись #59 / Удаление всех ревизий кроме указанной

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
from System.Collections.Generic import *

Запись #57 / Раскидываем ссылки по рабочим наборам

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
from System.Collections.Generic import *

Запись #53 / Меняем Worksets в Dynamo

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *
doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
from System.Collections.Generic import *

Запись #52 / Немного JS [поиск уникальных значений в списках]

<script>
var int = [1, 2, 3];
var ints = [2];
var intr = [];
s=0;
for (var j = 0, len = int.length; j < len; j++) {
	for (var k = 0, lens = ints.length; k < lens; k++) {
	if (int[j] == ints[k]) {
	delete int[j];//{intr[s] = int.splice(j, 1);
	}
	}
}
for (var t = 0, len = int.length; t < len; t++) {
if (int[t] != null) {
intr[s] = int[t];
s++;
}
}
document.write(intr);
</script>

 

Tag: 

Запись #51 / Получение параметра через get_Parameter

import clr

clr.AddReference("RevitAPI")
clr.AddReference("RevitServices")

import Autodesk
import RevitServices

from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager

doc =  DocumentManager.Instance.CurrentDBDocument

collector = FilteredElementCollector(doc)
els = collector.OfCategory(BuiltInCategory.OST_PipeCurves).ToElements()


out = []
for el in els:
    for param in el.Parameters:
        if param.IsShared and param.Definition.Name == 'Parameter1':
            paramValue = el.get_Parameter(param.GUID)

Pages