Revit API

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

Accessing text in lables of Template in a View

162 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

Active Member
Dollih
Posts: 10
Registered: ‎01-08-2002
Message 2 of 2 (141 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Revit Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Revit helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Revit

Twitter

Facebook

Blogs

Youtube