Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting values of builtin parameters of viewsheets

1 REPLY 1
Reply
Message 1 of 2
s_solt
1390 Views, 1 Reply

Getting values of builtin parameters of viewsheets

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

 

 

 

1 REPLY 1
Message 2 of 2
saikat
in reply to: s_solt

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

 



Saikat Bhattacharya
Senior Manager - Technology Consulting

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community