Message 1 of 2
Getting values of builtin parameters of viewsheets

Not applicable
01-07-2013
03:23 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have been trying to get the values of some of the parameters (mostly built-in but drawing status does not appear to be) of the printable viewsheets in the project. However, this code, which successfully iterates the sheets returns nothing for the parameters when I can see they have valid data via the Revit property window. Where am I going wrong?
Dim collector As New FilteredElementCollector(doc) collector.OfClass(GetType(ViewSheet)) For Each sht As ViewSheet In collector If Not sht.IsTemplate Then If sht.CanBePrinted Then oDwg = New clsDrawing(frm) oDwg.ProjectNo = frm.ProjectNo oDwg.SheetNumber = sht oDwg.RevitDoc = doc oDwg.Title = sht.Name If oDwg.Valid Then oDwg.Scale = sht.Scale Dim para As Parameter Try para = sht.Parameter(BuiltInParameter.SHEET_CURRENT_REVISION) oDwg.Rev = para.AsString para = sht.Parameter(BuiltInParameter.SHEET_CURRENT_REVISION_DESCRIPTION) oDwg.RevDesc = para.AsString para = sht.Parameter(BuiltInParameter.SHEET_ISSUE_DATE) oDwg.RevDate = para.AsString Catch ex As Exception Debug.Print(ex.Message) End Try For Each para2 As Parameter In sht.Parameters Select Case para2.Definition.Name Case "Drawing Status" oDwg.Status = para2.AsValueString End Select Next Dim result As String = oDwg.DwgToPlanchest(con) End If End If End If Next