I am trying to convert a C# code (for revit API) to python but to no luck. The C# code looks:
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
Document doc = commandData.Application.ActiveUIDocument.Document;
Reference r = commandData.Application.ActiveUIDocument.Selection.PickObject(Autodesk.Revit.UI.Selection.ObjectType.Element, "please select wall");
IEnumerable<Element> associate = new FilteredElementCollector(doc).OfClass(typeof(FamilyInstance)).Where(m=>(m as FamilyInstance).Host.Id == r.ElementId);
return Result.Succeeded;
}
what I am having problem with is the part .Where(m=>(m as FamilyInstance).Host.Id == r.ElementId);
I use pyrevit.
can anyone suggest how to do it?
thank you!