Calculate Length of Sketch path of Model in Place (Sweep) on Schedule

Calculate Length of Sketch path of Model in Place (Sweep) on Schedule

worrachot_work
Explorer Explorer
163 Views
0 Replies
Message 1 of 1

Calculate Length of Sketch path of Model in Place (Sweep) on Schedule

worrachot_work
Explorer
Explorer

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

0 Likes
164 Views
0 Replies
Replies (0)