<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic GetXData for all ACADPoints inside a block. in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getxdata-for-all-acadpoints-inside-a-block/m-p/13771665#M165957</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some data I want to extract from a dwg - I do it by creating a block, then adding an ACADPoint for each datapoint and then using the SetXdata method to add 8 len array to each ACAD point.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I want to get the data out by using GetXData method on each ACAD point for the block, but am not able to access the ACAD points inside the block. I have tried a few things I found on this forum and others, but in vain.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the example code, any help is appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual"&gt;Sub myFunc()

    Dim blockRef As Object
    Dim blockName As String
    Dim blockFound As Boolean
    
    ' Set the block name you want to retrieve
    blockName = "my-block"
    blockFound = False
    
    ' Loop through the ModelSpace to find the block
    For Each blockRef In ThisDrawing.ModelSpace
        If blockRef.ObjectName = "AcDbBlockReference" Then
            If blockRef.Name = blockName Then
                
                ' Block found, you can access its properties here
                MsgBox "Block found: " &amp;amp; blockRef.Name

                For Each obj In blockRef.Name
                    If Not IsNull(obj.GetXData) Then
                        xData = obj.GetXData
                        ' Process the Xdata as needed
                        For i = LBound(xData) To UBound(xData)
                            Debug.Print xData(i) 
                        Next i
                    End If
                Next obj
                
                blockFound = True
                
                Exit For
            End If
        End If
    Next blockRef
    
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that the easier solution is to store it as block attributes, but unfortunately I have to use AUTOCAD 2006 (for legacy reasons) for this task. And storing block attributes doesn't work in that version.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Aug 2025 08:21:39 GMT</pubDate>
    <dc:creator>nmeertens</dc:creator>
    <dc:date>2025-08-18T08:21:39Z</dc:date>
    <item>
      <title>GetXData for all ACADPoints inside a block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getxdata-for-all-acadpoints-inside-a-block/m-p/13771665#M165957</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some data I want to extract from a dwg - I do it by creating a block, then adding an ACADPoint for each datapoint and then using the SetXdata method to add 8 len array to each ACAD point.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now, I want to get the data out by using GetXData method on each ACAD point for the block, but am not able to access the ACAD points inside the block. I have tried a few things I found on this forum and others, but in vain.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the example code, any help is appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual"&gt;Sub myFunc()

    Dim blockRef As Object
    Dim blockName As String
    Dim blockFound As Boolean
    
    ' Set the block name you want to retrieve
    blockName = "my-block"
    blockFound = False
    
    ' Loop through the ModelSpace to find the block
    For Each blockRef In ThisDrawing.ModelSpace
        If blockRef.ObjectName = "AcDbBlockReference" Then
            If blockRef.Name = blockName Then
                
                ' Block found, you can access its properties here
                MsgBox "Block found: " &amp;amp; blockRef.Name

                For Each obj In blockRef.Name
                    If Not IsNull(obj.GetXData) Then
                        xData = obj.GetXData
                        ' Process the Xdata as needed
                        For i = LBound(xData) To UBound(xData)
                            Debug.Print xData(i) 
                        Next i
                    End If
                Next obj
                
                blockFound = True
                
                Exit For
            End If
        End If
    Next blockRef
    
End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that the easier solution is to store it as block attributes, but unfortunately I have to use AUTOCAD 2006 (for legacy reasons) for this task. And storing block attributes doesn't work in that version.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Aug 2025 08:21:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getxdata-for-all-acadpoints-inside-a-block/m-p/13771665#M165957</guid>
      <dc:creator>nmeertens</dc:creator>
      <dc:date>2025-08-18T08:21:39Z</dc:date>
    </item>
    <item>
      <title>Re: GetXData for all ACADPoints inside a block.</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getxdata-for-all-acadpoints-inside-a-block/m-p/13773016#M165987</link>
      <description>&lt;P&gt;"&lt;SPAN&gt;storing block attributes doesn't work" bl&lt;/SPAN&gt;ocks with attributes has existed since way before 2006. Can not remember if Invisible is supported in blocks in 2006, that way they exist but not shown. But you should be able to get attribute values. Not sure when Vla-get/put attributes started.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Aug 2025 00:46:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getxdata-for-all-acadpoints-inside-a-block/m-p/13773016#M165987</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2025-08-19T00:46:29Z</dc:date>
    </item>
  </channel>
</rss>

