Option Strict Off 'Imports Autodesk.AutoCAD.Interop 'Imports Autodesk.AutoCAD.Interop.Common Public Class Form1 'Public acad As AcadApplication 'Public mspace As AcadModelSpace Public acad As Object Public mspace As Object Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click getxdata() End Sub Private Sub getxdata() 'Dim doc As AcadDocument 'Dim elem As AcadEntity Dim doc As Object Dim elem As Object Dim s As String Dim a As Object, b As Object Dim i As Integer, y As Integer, x As Integer Dim sset As Object acad = GetObject(, "AutoCAD.Application") doc = acad.ActiveDocument mspace = doc.ModelSpace AppActivate(acad.caption) sset = doc.SelectionSets.Add("getXData") sset.SelectOnScreen() ListBox1.Items.Clear() For Each elem In sset >> a = Nothing >> b = Nothing With elem .GetXData("", a, b) If Not IsNothing(a) Then For i = LBound(b) To UBound(b) If IsArray(b(i)) Then y = y + 1 For x = LBound(b(i)) To UBound(b(i)) s = s & i & "(" & x & ")" & ": " & b(x) ListBox1.Items.Add(i & "(" & x & ")" & ": " & b(x)) Next Else s = s & i & ": " & a(i) & ": " & b(i) ListBox1.Items.Add(i & ": " & a(i) & ": " & b(i)) End If Next Else MsgBox("Keine Xdata vorhanden") End If End With ListBox1.Items.Add("---------------------------------------------------------") Next elem AppActivate(Me.Text) doc.SelectionSets.Item("getXData").Delete() sset = Nothing End Sub End Class