Revit API

Revit API

Reply
Active Member
Dollih
Posts: 10
Registered: ‎01-08-2002
Message 1 of 2 (186 Views)
Accepted Solution

Accessing text in lables of Template in a View

186 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
Dollih
Posts: 10
Registered: ‎01-08-2002
Message 2 of 2 (165 Views)

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
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.