Reading parameter values in linked elements

Reading parameter values in linked elements

Anonymous
Not applicable
1,134 Views
1 Reply
Message 1 of 2

Reading parameter values in linked elements

Anonymous
Not applicable

Hi.

I'm working in Rvt2014, and i'm trying to get some parameter values from elements in linked models.

I can get the element, and read the parameter values, but for some reason I can't retrieve the values in some of them, (Mark, Comments, Type mark...) even when they exists...(instance and type parameters)

Here is my code for testing propose:

 

Public Sub t1()
        Dim ref As Reference 
        Dim elem2 As Element
        Dim elem As Element
        Dim proyecto As String
        Dim elem3 As Element
         ref = ActiveUIDocument .Selection.PickObject(ObjectType.LinkedElement, "Seleccione tuberia, conducto o bandeja")        

        elem2 = ActiveUIDocument .Document .GetElement(ref.ElementId) 'documento que contiene el elemento
             

             For Each docs As Document In Application.Documents 'busco el archivo linkeado 
                 If docs.IsLinked Then
                     If InStr(elem2.Name, docs.Title) Then
                         elem = docs.GetElement(ref.LinkedElementId) 'ele elemento,
                          elem3=docs.GetElement (elem.GetTypeId )
                         proyecto = docs.Title
                     End If
                 End If
             Next
             
            
             Dim mensaje As String
             Dim parametros As ParameterSet 
             parametros=elem.Parameters 
             For Each p As Parameter In parametros
                 mensaje=mensaje  & p.Definition.Name & ": " & p.AsValueString    & vbCr
             Next
             TaskDialog .Show ("INFO",mensaje)
     End Sub

 

 

Can someone help me please?

Thankyou

0 Likes
Accepted solutions (1)
1,135 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

Ups, I realized that .AsString works fine... I make a mistake when tested it for the first time...

Thanks