Skip to Content

VBS-Codeexample: Getting the List of Extended Attributes of an object

Dear Readers,

this article is Related to PD 16.1.0, i had no chance to test it on higher versions and maybe the usecase i describe is already implemented in higher versions.

i had the Problem that i wanted to get the LIST of extended Attributes of an Object, but i couldn´t find a function which serves my needs. So i wrote it.

using Output obj.ExtendedAttributesText, you´ll get somethig like this:

(depending on the Extended Attrivutes connected to your object)



    {D96ADDC0-370E-485C-84EF-127BA7D58CA3},Kommentar,8=Kein ODP


The values in {} are the internal ID´s of the EA´s folloed by ea´s name and a size=value tuple

Function getExtendedAttributes(obj)

    Dim eaArray , eaValues

    eaArray  = Split(obj.ExtendedAttributesText, “{“)

    Dim i

    ReDim eaNames(UBound(eaArray ) – 1)

    For i = 2 To UBound(eaArray )

        eaValues = Split(eaArray (i), “,”)

        eaNames(i – 1) = eaValues(1)

    Next ‘i

    ‘For i = 1 To UBound(eaNames)

    ‘   Output i &”:” & eaNames(i)

    ‘Next ‘i

    getExtendedAttributes = eaNames

End Function

Feel free to extend or comment this article , but also to show me the right function to get the List of EA´s in Metamodel Objects Help



1 Comment
You must be Logged on to comment or reply to a post.
  • Hi Dirk,

    This might be an option as well:

    dim l_extAttrs, l_extAttr

    dim l_fullName

    set l_extAttrs = <<your model>>.GetMetaExtensionsForInstance(<<your object>>, PdCommon.Cls_ExtendedAttributeTargetItem)

    for each l_extAttr in l_extAttrs

         l_fullName = & "." &

         output "Attribute: " & l_fullName & " has the value: " & cstr(<<your object>>.getExtendedAttribute(l_fullName))


    It should be somthing like that. Let me know if you can't get it to work.