See Below. Can't remember where I got it from. Someone Else's suggestion.
Set these up as separate elements for _AecX and _XUILand then reference them. You'll need them for both pipes / manholes in some instances, swap depending to what you are doing (review the Customisation Guide for compoenents of each.).
Then use them as needed, example below.
RESULT="-"
On Error Resume Next
Set oApp=GetObject(, "AutoCAD.Application")
Set oCivilApp=oApp.GetInterfaceObject("[_XUILand]")
Set obj=oCivilApp.ActiveDocument.HandleToObject("[Handle]")
RESULT=obj.Name
RESULT = "--"
On Error Resume Next
Set app=GetObject(, "AutoCAD.Application")
If InStr(app.Version, "24.3") > 0 Then
RESULT = "AecX.AecBaseApplication.8.6"
ElseIf InStr(app.Version, "24.2") > 0 Then
RESULT = "AecX.AecBaseApplication.8.5"
ElseIf InStr(app.Version, "24.1") > 0 Then
RESULT = "AecX.AecBaseApplication.8.4"
ElseIf InStr(app.Version, "24.0") > 0 Then
RESULT = "AecX.AecBaseApplication.8.3"
ElseIf InStr(app.Version, "25.0") > 0 Then
RESULT = "AecX.AecBaseApplication.8.7"
End If
RESULT = "--"
On Error Resume Next
Set app=GetObject(, "AutoCAD.Application")
If InStr(app.Version, "24.3") > 0 Then
RESULT = "AeccXUiLand.AeccApplication.13.6"
ElseIf InStr(app.Version, "24.2") > 0 Then
RESULT = "AeccXUiLand.AeccApplication.13.5"
ElseIf InStr(app.Version, "24.1") > 0 Then
RESULT = "AeccXUiLand.AeccApplication.13.4"
ElseIf InStr(app.Version, "24.0") > 0 Then
RESULT = "AeccXUiLand.AeccApplication.13.3"
ElseIf InStr(app.Version, "25.0") > 0 Then
RESULT = "AeccXUiLand.AeccApplication.13.7"
End If
Mike