Will get back a ID from a Block

#1
Hello,
this Function works under ACad very good...
it doesn't run unter Intellicad...
How does ist works???


Public Function GetIDFromBlock(WähleObject As Boolean, _
BlockName As String, _
Gesuchtes_Attribut As String) As Boolean
On Error GoTo fehler
Dim i As Integer
Dim found_PlankopfID As Boolean
Dim pickedPoint As Variant

GetIDFromBlock = False
acadApp.Visible = True

RestoreWindow acadApp.caption

If WähleObject = True Then


acadApp.ActiveDocument.Utility.GetEntity ActObj, pickedPoint, "Block wählen (" & BlockName & ")..."


End If

found_PlankopfID = False
If TypeName(ActObj) = "Nothing" Then Exit Function

If UCase$(ActObj.ObjectName) = "ACDBBLOCKREFERENCE" Then
If UCase$(ActObj.Name) = UCase$(BlockName) Then
If ActObj.HasAttributes = True Then

nvarAttrib = ActObj.GetAttributes
ReDim ARR_attribute1(UBound(nvarAttrib))
ReDim ARR_attribute2(UBound(nvarAttrib))

For i = LBound(nvarAttrib) To UBound(nvarAttrib)

ARR_attribute1(i) = nvarAttrib(i).TagString
ARR_attribute2(i) = nvarAttrib(i).TextString

Select Case UCase(nvarAttrib(i).TagString)

Case UCase$(Gesuchtes_Attribut)
IDvonACADBlock = nvarAttrib(i).TextString
GetIDFromBlock = True
found_PlankopfID = True

End Select

Next
End If
Else
RestoreWindow Application.caption
MsgBox "Blockattribut: '" & BlockName & "' erwartet.", vbInformation, "Hinweis"
GetIDFromBlock = False
Exit Function
End If
End If

If found_PlankopfID = False Then
MsgBox "Keine Plankopf-ID gefunden!", vbCritical, "Fehler"
GetIDFromBlock = False
End If

Exit Function
fehler:
GetIDFromBlock = False
ErrHandlerStandard
Exit Function
End Function

#2
I answered this via email and during the process of trying to understand the procedure manbuettner found the answer himself.

------------------
Regards
John Finlay
cron