Revit API

Revit API

Reply
Active Member
10 Posts
0 Kudos
Registered: ‎01-08-2002
Post 1 of 2
Accepted Solution

Accessing text in lables of Template in a View

188 Views, 1 Replies
11-22-2012 06:17 AM

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

Ok, found it.

It is stored in the View.Parameter :

 

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

 

Thanks anyway

Active Member
10 Posts
0 Kudos
Registered: ‎01-08-2002
Post 2 of 2

Re: Accessing text in lables of Template in a View

11-26-2012 01:59 AM in reply to: Dollih

Ok, found it.

It is stored in the View.Parameter :

 

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

 

Thanks anyway

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post