GUID/Global Unique Identifier

Hi,

Can anyone enlighten me as to how I get the GUID for a Microstation geometry element through VBA?

Thanks

  • gustav:

    Can anyone enlighten me as to how I get the GUID for a MicroStation geometry element through VBA?

    Each element in a DGN file has a unique 64-bit ElementID. The uniqueness belongs to the DGN file, so it is not globally unique. Two DGN files can contain elements having the same 64-bit ElementID.

    The property that returns an ElementID is simply Element.ID. Note: the ID returned is a DLong UDT, two 32-bit values packed into a structure.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • ' Return the GUID of the object specified in the first parameter

    ' Be sure that "TypeLib Information" type library (TlbInf32.tlb)
    ' is referenced in your VB/VBA project.

    Function GetObjectGUID(Object As ObjectAs String
        Dim TLI As New TLIApplication
        ' any error will be raised by TLI
        GetObjectGUID = TLI.InterfaceInfoFromObject(Object).Guid
    End Function
     
    Before apply, test whether object is not Nothing: If Not MyObject Is Nothing Then ...  
     
    HTH