PDA

View Full Version : Get the elements property



ponto_portuca
2006-01-14, 10:07 PM
hi i am new in API Revit, i am working in VB.net, and i am trying o get all the values like floor, doors...., that i have in the project, but the values that return its few and some are wrong, show you the code, i think dont now how to get the property Right and dont understand the concept you use to grab the information from project.

Have you example of a dataset, and its possible work with camera like create .avi in sun position? and how i send data to the project?

Thanks......

code:


Dim topRow As System.Data.DataRow
Dim tbusers As System.Data.DataTable
tbusers = New DataTable("data")


' using all the elements, find common properties amongst them
Dim propertyNames As Autodesk.Revit.Collections.Set = GetCommonPropertyNames(application, elementSet)

' now add the common property names as the column headers
Dim propertyName As String
Dim column As Integer = 2
For Each propertyName In propertyNames
tbusers.Columns.Add(propertyName, System.Type.GetType("System.String"))
Next

' devote a row to each element that belongs to the category
Dim element As Autodesk.Revit.Element
Dim row As Integer = 2
For Each element In elementSet

Dim values As Autodesk.Revit.Collections.Map = GetValuesOfNamedProperties(application, element, propertyNames)


If (values.IsEmpty = False) Then

For Each propertyName In propertyNames

If (values.Contains(propertyName)) Then
topRow = tbusers.NewRow
topRow.Item(propertyName) = CStr(values.Item(propertyName))
End If

Next
tbusers.Rows.Add(topRow)
End If
Next
DataGrid1.DataSource = tbusers

ponto_portuca
2006-01-17, 11:52 PM
well about getting the info i want and create the dataset i just did, now need send the info....