Status Bar or Progress Bar

Status Bar or Progress Bar

Anonymous
Not applicable
2,544 Views
3 Replies
Message 1 of 4

Status Bar or Progress Bar

Anonymous
Not applicable

Dear All,

 

I am reading all data(s) from Revit elements and writing to CSV file. Since process takes too much time i want user to know what’s happening through status bar.

 

But while searching the Revit API forum it seem directly API we can't access status bar. Please provide me some example to access status / progress bar in VB. Net.

 

Advance thanks

 

Vijay

 

0 Likes
2,545 Views
3 Replies
Replies (3)
Message 2 of 4

Revitalizer
Advisor
Advisor

Hi,

 

here you are:

http://thebuildingcoder.typepad.com/blog/2011/02/status-bar-text.html

It's C#, but you may find ways to convert it into its VB.net equivalent.

 

Additionally, you could implement your own progressbar by displaying a dialogue containing such a gui control.

There is no access to the Revit built-in progressbar residing in the status bar.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes
Message 3 of 4

Anonymous
Not applicable
My code for extracting all element data to CSV
Public Sub Report()
Dim stm As DateTime
Dim ct As Integer
Dim sTemp As String = Nothing
Dim etm As DateTime
Dim uiDoc As UIDocument = Application.ActiveUIDocument
Dim viewElementCollector As FilteredElementCollector
Dim el As Element
Dim elid As ElementId
Dim FileWriter As StreamWriter
Dim MyFilename As String = "d:\revit2csv.xls"
stm = DateTime.Now
viewElementCollector = New FilteredElementCollector(uiDoc.Document , uiDoc.Document.ActiveView.Id)
ct = viewElementCollector.Count
TaskDialog.Show("Revit to Excel ", "Total Elements : " + ct.ToString )' + Environment.NewLine + "Please Wait!!!" )
FileWriter = New StreamWriter(MyFilename, False)
For i = 0 To (ct-1)
el = viewElementCollector.ElementAt(i)
elid = el.Id
For Each para As Parameter In el.Parameters
sTemp = elid.ToString & "," & para.Definition.Name & "," & para.StorageType & "," & para.AsString & para.AsValueString
FileWriter.WriteLine(sTemp)
Next
Next
FileWriter.Close()
etm = DateTime.Now
TaskDialog.Show("Revit to Excel ", "Process Completed!!!" + Environment.NewLine + ct.ToString + " element(s) processed." + Environment.NewLine + "Excel report created."+ Environment.NewLine + "Start Time : " + stm.ToString + Environment.NewLine + "End Time : " + etm.ToString )
End Sub

But takes long time....
Is there any alternative, please suggest...

Thx
0 Likes
Message 4 of 4

Revitalizer
Advisor
Advisor

Hi,

 

you are exporting every element visible in a view, getting all the element parameters.

 

On the one hand, you could apply a MultiCategoryFilter, saying only walls, doors etc.

On the other hand, what about type parameters ?

In fact, you only export half the information when ignoring them.

 

So, limit your export categories to increase performance.

But when doing so, you could have gained the time to export also type information.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine