Calculate Length of Sketch path of Model in Place (Sweep) on Schedule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
i want to find the length of the Model in place by sweep, or in other words the length of the Path, and I want it to be displayed in a quantity table , without manually measuring the path length in Edit Sweep and entering it into the parameter field.
i try to use Dynamo With this code but isnt working
import clr
clr.AddReference('RevitAPI')
clr.AddReference('RevitServices')
from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
elements = UnwrapElement(IN[0])
param_name = IN[1]
lengths = IN[2]
TransactionManager.Instance.EnsureInTransaction(doc)
for i in range(len(elements)):
el = elements[i]
param = el.LookupParameter(param_name)
if param and not param.IsReadOnly:
try:
param.Set(lengths[i])
except:
pass
TransactionManager.Instance.TransactionTaskDone()
OUT = elements