BIM360

BIM360

ahmed.errazak
Enthusiast Enthusiast
1,250 Views
5 Replies
Message 1 of 6

BIM360

ahmed.errazak
Enthusiast
Enthusiast
Hello everyone,
When I use my subroutine on my model that is on the server or hard drive it works very well
But once I want to use it on a project that is on the "Cloud" BIM360
It turns in a loop?
Someone has an explanation to give me

 

0 Likes
Accepted solutions (1)
1,251 Views
5 Replies
Replies (5)
Message 2 of 6

xiaodong_liang
Autodesk Support
Autodesk Support

Hi @ahmed.errazak ,

 

Sorry I am not much in the understanding of your question. Could you elaborate which job you subroutine does? It will be helpful to know the context if with a demo video..

 

 

0 Likes
Message 3 of 6

ahmed.errazak
Enthusiast
Enthusiast
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;
}
}
}

0 Likes
Message 4 of 6

xiaodong_liang
Autodesk Support
Autodesk Support

Hi @ahmed.errazak ,

 

My apology for the late response! I had a holiday these days. Thank you for providing the information and code. Please bear with me trying to understand further. 

 

The code is a common plugin of Revit. It searches out specific model elements with filter. With my knowledge, it should work only within Revit desktop. While you said 'the code does not work with BIM 360 '. BIM 360 has not yet supported any plugin within BIM 360.  I would think what you meant is: open the BIM 360 file within Revit and run the code within Revit.  

 

I will do a test in such scenario and get back to you soon.  However If I misunderstood anything, please let me know.

0 Likes
Message 5 of 6

xiaodong_liang
Autodesk Support
Autodesk Support

Hi @ahmed.errazak ,

 

so, I followed my understanding to setup the plugin project and test local Revit file and the file from BIM 360. Since you did not provide complete codes, I defined one variable for  AllSystem_Isolate.ListAllSystemIsolate.  The test Revit file is sample rme_advanced_sample_project.rvt 

It looks it works well with both local file and file of BIM 360. My test video is also attached.

https://myshare.autodesk.com/:v:/g/personal/xiaodong_liang_autodesk_com/ETfCecaFAtdDu5oWbgx0URABrEih...

 

If my test steps are different to yours, please also make a video on how you performed the test. It will help me to understand better on the steps.

If my test steps are correct, but the problem happens with specific model, please isolate and share a demo Revit file (you can email me privately if this is a confidential file).My email is:  xiaodong.liang@autodesk.com 

0 Likes
Message 6 of 6

ahmed.errazak
Enthusiast
Enthusiast
Accepted solution
Thank you
It finally works :smileyhappy:
0 Likes