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: 

Accessing text in lables of Template in a View

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Dollih
404 Views, 1 Reply

Accessing text in lables of Template in a View

Hi.

I am having trouble reading text in labels of templates, I can read the lable name but I dont know how to get the text from it.

Here is the code Im using:

 

       

Dim collector AsNewFilteredElementCollector(ExtCmd.CachedUiApp.ActiveUIDocument.Document)

       

Dim collection AsICollection(OfElement) = collector.OfClass(GetType(ViewSheet)).ToElements()

       

ForEach element AsElementIn collection

           

If SKRTegund = element.Name.ToString Then

               

Dim planView AsViewSheet = Nothing

               

Dim views AsList(OfElement) = collector.OfClass(GetType(View)).ToElements

               

ForEach v AsViewIn views

                   

If v.Name = SKRTegund Then

                        planView = v

                       

Dim IDS AsIList(OfElementId) = planView.GetTemplateParameterIds

                       

ForEach stre In IDS

                           

If stre.IntegerValue > 0 Then

                               

Dim Elllem AsElement = ExtCmd.CachedDoc.GetElement(stre)

 

 

                                MsgBox(Elllem.Name.ToString)

                           

EndIf

                       

Next

                        MsgBox(planView.Parameter(

BuiltInParameter.SHEET_CURRENT_REVISION).AsString)

                        MsgBox(planView.Parameter(

BuiltInParameter.SHEET_CURRENT_REVISION_DATE).AsString)

                        MsgBox(planView.Parameter(

BuiltInParameter.SHEET_CURRENT_REVISION_DESCRIPTION).AsString)

 

 

                        MsgBox(planView.SheetNumber.ToString)

                        MsgBox(planView.Name)

                   

EndIf

               

Next

 

 

Best regards

1 REPLY 1
Message 2 of 2
Dollih
in reply to: Dollih

Ok, found it.

It is stored in the View.Parameter :

 

planView.Parameter(Elllem.Name.ToString).AsString

 

Thanks anyway

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