Hey,
Well, as long as I work on my hard drive or on the server, all of my programs work well.
But once I am on the BIM360, it only blocks when I use a search function or with a filter.
attached a program translated into C ++
I personally use Vb Net
But this program works very well, If i am not on BIM360
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualBasic;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
namespace Modifie
{
[Transaction(TransactionMode.Manual)]
[Regeneration(RegenerationOption.Manual)]
public class Roosters_Isolate : IExternalCommand
{
private List<ElementId> RoosterListe = new List<ElementId>();
private List<string> RListAllSystem = new List<string>();
public Result Execute(ExternalCommandData commandData, ref string Message, ElementSet Elements)
{
UIApplication Uiapp = commandData.Application;
UIDocument Uidoc = Uiapp.ActiveUIDocument;
Application App = Uiapp.Application;
Document Doc = Uidoc.Document;
Selection Sel = Uidoc.Selection;
View MView = Doc.ActiveView;
// REM Isolate all Air terminal
try
{
// REM AirTerminal
ElementCategoryFilter RoosterFilter = new ElementCategoryFilter(BuiltInCategory.OST_DuctTerminal);
FilteredElementCollector RCollector = new FilteredElementCollector(Doc);
IList<Element> RoosterList = RCollector.WherePasses(RoosterFilter).WhereElementIsNotElementType().ToElements();
foreach (Element RoosterEl in RoosterList)
RoosterListe.Add(RoosterEl.Id);
// All System
FilteredElementCollector systems = new FilteredElementCollector(Doc).OfClass(typeof(MEPSystem));
foreach (MEPSystem system in systems)
RListAllSystem.Add(system.Name);
int ind = 0;
do
{
FilteredElementCollector FiltreColl = new FilteredElementCollector(Doc);
ParameterValueProvider ParamValProv = new ParameterValueProvider(new ElementId(BuiltInParameter.RBS_SYSTEM_NAME_PARAM));
FilterStringRuleEvaluator FSRE = new FilterStringEquals();
FilterRule FiltreRules = new FilterStringRule(ParamValProv, FSRE, RListAllSystem[ind].ToString(), true);
ElementParameterFilter ElemParamFilter = new ElementParameterFilter(FiltreRules);
FiltreColl = FiltreColl.WherePasses(ElemParamFilter);
foreach (Element ElementX in FiltreColl)
AllSystem_Isolate.ListAllSystemIsolate.Add(ElementX.Id);
ind = ind + 1;
}
while (!ind == RListAllSystem.Count);
// REM Hide all systeme
Transaction Trans = new Transaction(Doc);
Trans.Start("IsolateElementen");
MView.HideElements(AllSystem_Isolate.ListAllSystemIsolate);
Trans.Commit();
// REM UnHide only Air terminal
Transaction Transa = new Transaction(Doc);
Transa.Start("IsolateElementen");
MView.UnhideElements(RoosterListe);
Transa.Commit();
}
catch
{
TaskDialog.Show("ERROR ", "Zie Roosters_Isolate");
}
return Result.Succeeded;
}
}
}