PathOfTravelCalculationStatus

Hi, is it possible to access to : PathOfTravelCalculationStatus enumeration value ?
Daniel OLIVES

1 Like

@daniel82KGE ,

I come until here…

import sys
import clr

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *
from Autodesk.Revit.DB.Analysis import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument
routeSettings = RouteAnalysisSettings.GetRouteAnalysisSettings(doc)

path = FilteredElementCollector(doc).OfClass(Analysis.PathOfTravel).ToElements()
way = UnwrapElement(path)


OUT = path, way

Yes. Load in the Autodesk.Revit.DB.Analysis class and you should be able to access the enumeration directly.

1 Like

Hy, Thank for the answer
Daniel

1 Like

L_Durée, L_Vitesse, L_Niveaux, L_Vues, L_HabOrigine, L_HabDestination, L_Status = [],[],[],[],[],[],[]
for r in paths :
    temps = r.get_Parameter(BuiltInParameter.PATH_OF_TRAVEL_TIME).AsDouble()
    L_Durée.append(temps)
    #
    vitesse = r.get_Parameter(BuiltInParameter.PATH_OF_TRAVEL_SPEED).AsDouble()
    # avant Revit 2022
    #vitesse.append(UnitUtils.ConvertFromInternalUnits(vitesse, DisplayUnitType.DUT_KILOMETERS_PER_HOUR))
    # à partir de Revit 2022
    L_Vitesse.append(UnitUtils.ConvertFromInternalUnits(vitesse,UnitTypeId.KilometersPerHour))
    #
    niveaux = r.get_Parameter(BuiltInParameter.PATH_OF_TRAVEL_LEVEL_NAME).AsString()
    L_Niveaux.append(niveaux)
    #
    vues = r.get_Parameter(BuiltInParameter.PATH_OF_TRAVEL_VIEW_NAME).AsString()
    L_Vues.append(vues)
    #
    origine = r.get_Parameter(BuiltInParameter.PATH_OF_TRAVEL_FROM_ROOM).AsString()
    L_HabOrigine.append(origine)
    #
    destination = r.get_Parameter(BuiltInParameter.PATH_OF_TRAVEL_TO_ROOM).AsString()
    L_HabDestination.append(destination)
    #
    status = PathOfTravelCalculationStatus(r)
#    L_Status.append(status)

OUT = paths, L_Durée, L_Vitesse, L_Niveaux, L_Vues, L_HabOrigine, L_HabDestination#, L_Status
1 Like

Hi, Andrea and Jacob
Here i my code, but for status i have an error.
TypeError : cannot instantiate enumeration
in ligne: status = PathOfTravelCalculationStatus(r)

Dynamo 2.16 - Revit 2023.1
Daniel

Why do you need the enumeration values?

@daniel82KGE ,

thats all … :wink:

2022-12-16_11h29_24
KR
Andreas

Hi, thank’s it’s just a test to extract this value !
The Status of the path
Daniel

1 Like