Need help on path of travel

How to convert list to Ilist?

import clr
import System
from System import Array
from System.Collections.Generic import *
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
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 *
from Autodesk.Revit.DB.Analysis import *

doc = DocumentManager.Instance.CurrentDBDocument
av = doc.ActiveView

room = UnwrapElement(IN[0])
exit = UnwrapElement(IN[1])
room_pt = [p.ToXyz() for p in room]
exit_pt = exit.ToXyz()

TransactionManager.Instance.EnsureInTransaction(doc)

map = PathOfTravel.CreateMapped(av,room_pt,exit_pt)

TransactionManager.Instance.TransactionTaskDone()

OUT = map

image

wrap your xyx in square brackets on line 28

2 Likes

To clarify what @Alien is saying, the issue is not that your list of points is not an IList. It’s that the method requires a list of starting points and a list of end points - where you’re only supplying a singular end point.
image

2 Likes

oh I didn’t notice that the end point is not a list haha, thanks for pointing out! :slight_smile: