<?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 Re: Error 451 on get coordinates code in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/error-451-on-get-coordinates-code/m-p/7635291#M7142</link>
    <description>&lt;P&gt;I suppose you are using 64-bit AutoCAD, 2014 or later (thus 64-bit VBA).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code should have been worked in earlier 32-bit VBA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Minor change would fix the error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Get_Points()

     Dim ent As AcadEntity
     &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Dim line As AcadLine&lt;/FONT&gt;&lt;/STRONG&gt;
     
     Dim name As String
     Dim x As Double
     Dim y As Double
     Dim z As Double

     For Each ent In ThisDrawing.ModelSpace

          If TypeOf ent Is AcadLine Then
               name = ent.Handle
               &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Set line = ent&lt;/STRONG&gt;&lt;/FONT&gt;
               x = line.StartPoint(0)
               y = line.StartPoint(1)
               z = line.StartPoint(1)
          End If

     Next

End Sub&lt;/PRE&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
    <pubDate>Tue, 19 Dec 2017 14:43:01 GMT</pubDate>
    <dc:creator>Norman_Yuan</dc:creator>
    <dc:date>2017-12-19T14:43:01Z</dc:date>
    <item>
      <title>Error 451 on get coordinates code</title>
      <link>https://forums.autodesk.com/t5/vba-forum/error-451-on-get-coordinates-code/m-p/7633924#M7141</link>
      <description>&lt;P&gt;The following code is supposed to loop through each line in the drawing and get the startpoint x, y and z values but instead I error 451. I copied this code from something else that works so I am at a loss here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub Get_Points()&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;Dim ent As AcadEntity&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;Dim name As String&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;Dim x As Double&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;Dim y As Double&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;Dim z As Double&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;For Each ent In ThisDrawing.ModelSpace&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;If TypeOf ent Is AcadLine Then&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;name = ent.Handle&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;x = ent.StartPoint(0)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;y = ent.StartPoint(1)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;z = ent.StartPoint(1)&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;End If&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;Next&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 04:34:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/error-451-on-get-coordinates-code/m-p/7633924#M7141</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-19T04:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error 451 on get coordinates code</title>
      <link>https://forums.autodesk.com/t5/vba-forum/error-451-on-get-coordinates-code/m-p/7635291#M7142</link>
      <description>&lt;P&gt;I suppose you are using 64-bit AutoCAD, 2014 or later (thus 64-bit VBA).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code should have been worked in earlier 32-bit VBA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Minor change would fix the error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sub Get_Points()

     Dim ent As AcadEntity
     &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Dim line As AcadLine&lt;/FONT&gt;&lt;/STRONG&gt;
     
     Dim name As String
     Dim x As Double
     Dim y As Double
     Dim z As Double

     For Each ent In ThisDrawing.ModelSpace

          If TypeOf ent Is AcadLine Then
               name = ent.Handle
               &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Set line = ent&lt;/STRONG&gt;&lt;/FONT&gt;
               x = line.StartPoint(0)
               y = line.StartPoint(1)
               z = line.StartPoint(1)
          End If

     Next

End Sub&lt;/PRE&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 19 Dec 2017 14:43:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/error-451-on-get-coordinates-code/m-p/7635291#M7142</guid>
      <dc:creator>Norman_Yuan</dc:creator>
      <dc:date>2017-12-19T14:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Error 451 on get coordinates code</title>
      <link>https://forums.autodesk.com/t5/vba-forum/error-451-on-get-coordinates-code/m-p/7636423#M7143</link>
      <description>&lt;P&gt;Just to point out a little typo:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt; z = line.StartPoint(2)&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Dec 2017 20:53:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/error-451-on-get-coordinates-code/m-p/7636423#M7143</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-12-19T20:53:43Z</dc:date>
    </item>
  </channel>
</rss>

