Returns a Boolean that indicates whether an entity is a descendant of another entity.
<HsvEntities>.IsDescendant lParentID, lEntityID, pbIsDescendant
The following example creates a function that takes the labels of an entity and its possible descendant entity and returns a Boolean indicating whether there is an ancestor – descendant relationship.
Function IsEntityDescendant(sParent As String, sIsDescend _
As String) As Boolean
Dim cEntities As HsvEntities, cTreeInfo As IHsvTreeInfo
Dim lParID As Long, lDescID As Long, bIsDesc As Boolean
Set cEntities = m_cMetadata.Entities
Set cTreeInfo = m_cMetadata.Entities
lParID = cTreeInfo.GetItemID(sParent)
lDescID = cTreeInfo.GetItemID(sIsDescend)
cEntities.IsDescendant lParID, lDescID, bIsDesc
IsEntityDescendant = bIsDesc
End Function