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
Hi
I quickly checked using Revit LookUp (that is included in the SDK) that the Sheet Issue Date value can be extracted using the Value property. With your Revit model, can you see the values of the builtin parameters using Revit LookUp?
If you are still having problems, will it be possible to attach a simple, non-confidential RVT file which has all the builtin parameters that you wish to extract populated and then I can look further on why the values are being returned as null.
thanks