<?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: Runtime Error in VBA Code in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9109226#M5109</link>
    <description>&lt;P&gt;Hi EdJobe,&amp;nbsp;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;thanks for answering&lt;/SPAN&gt;&lt;/SPAN&gt;.&amp;nbsp;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Error occurs early in code&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Debug.Print "Number of Entities: "; &lt;/EM&gt;&lt;STRONG&gt;&lt;EM&gt;oAlignment.Entities.Count&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 25 Oct 2019 16:57:25 GMT</pubDate>
    <dc:creator>sergiopedroza</dc:creator>
    <dc:date>2019-10-25T16:57:25Z</dc:date>
    <item>
      <title>Runtime Error in VBA Code</title>
      <link>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9105692#M5107</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN&gt;I am trying to execute a vba code in Civil 3D but it is giving a runtime error: Invalid use of property.&lt;/SPAN&gt; &lt;SPAN&gt;The code follows below&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Sub list_alignment_entyties()&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Dim i As Integer&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Dim oTangent As AeccAlignmentTangent&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Dim oArc As AeccAlignmentArc&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Dim oSpiral As AeccAlignmentSpiral&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Dim oSCSGroup As AeccAlignmentSCSGroup&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Debug.Print "Number of Entities: "; &lt;/EM&gt;&lt;EM&gt;oAlignment.Entities.Count&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;For i = 0 To oAlignment.Entities.Count - 1&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Select Case (oAlignment.Entities.Item(i).Type)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Case aeccTangent&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Set oTangent = oAlignment.Entities.Item(i)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Debug.Print "Tangent length:" &amp;amp; oTangent.Length&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Case aeccArc&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Set oArc = oAlignment.Entities.Item(i)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Debug.Print "Arc radius:" &amp;amp; oArc.Radius&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Case aeccSpiral&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Set oSpiral = oAlignment.Entities.Item(i)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Debug.Print "Spiral A value:" &amp;amp; oSpiral.A&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Case aeccSpiralCurveSpiralGroup&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Set oSCSGroup = oAlignment.Entities.Item(i)&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Debug.Print "Radius of curve in SCS group:" _&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;amp; oSCSGroup.Arc.Radius&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;' And so on for AeccAlignmentSTSGroup,&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;' AeccAlignmentSTGroup, AeccAlignmentTSGroup&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;' AeccAlignmentSCGroup, and AeccAlignmentCSGroup types.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;End Select&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Next i&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;End Sub&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;BR /&gt;&lt;SPAN class=""&gt;I can't identify why the error occurs as this code is in AutoCAD Civil 3D API Developers Guide&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 11:05:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9105692#M5107</guid>
      <dc:creator>sergiopedroza</dc:creator>
      <dc:date>2019-10-24T11:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in VBA Code</title>
      <link>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9108931#M5108</link>
      <description>&lt;P&gt;Can you set a breakpoint and step through the code to identify which line gives the error?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 14:47:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9108931#M5108</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2019-10-25T14:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in VBA Code</title>
      <link>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9109226#M5109</link>
      <description>&lt;P&gt;Hi EdJobe,&amp;nbsp;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;thanks for answering&lt;/SPAN&gt;&lt;/SPAN&gt;.&amp;nbsp;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;Error occurs early in code&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Debug.Print "Number of Entities: "; &lt;/EM&gt;&lt;STRONG&gt;&lt;EM&gt;oAlignment.Entities.Count&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 16:57:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9109226#M5109</guid>
      <dc:creator>sergiopedroza</dc:creator>
      <dc:date>2019-10-25T16:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in VBA Code</title>
      <link>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9109261#M5110</link>
      <description>&lt;P&gt;Did you add the Debug statement? Are you sure you copied the code correctly? The reason I say this is because that's the first line after the dim statements and oAlignment has not been set yet. Any reference to it will be null. You can't get the Count property of something that doesn't exist.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 17:26:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9109261#M5110</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2019-10-25T17:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in VBA Code</title>
      <link>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9109277#M5111</link>
      <description>&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;I got the code here&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN class=""&gt;&lt;A href="http://help.autodesk.com/view/CIV3D/2016/ENU/?guid=GUID-3B57BD08-EDB3-4BDF-BC2B-94203B65D632" target="_blank" rel="noopener"&gt;http://help.autodesk.com/view/CIV3D/2016/ENU/?guid=GUID-3B57BD08-EDB3-4BDF-BC2B-94203B65D632&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 17:31:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9109277#M5111</guid>
      <dc:creator>sergiopedroza</dc:creator>
      <dc:date>2019-10-25T17:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in VBA Code</title>
      <link>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9109299#M5112</link>
      <description>&lt;P&gt;That isn't a complete code sample, it doesn't have anything that gets/selects an alignment. It doesn't even have a Sub/Function statement. My guess is that it assumes you are already familiar with basic AutoCAD programming before attempting the C3D api.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 17:41:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9109299#M5112</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2019-10-25T17:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in VBA Code</title>
      <link>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9109346#M5113</link>
      <description>&lt;P&gt;&lt;SPAN class="tlid-translation translation"&gt;&lt;SPAN&gt;ok. I have a little knowledge of vba with Excel, but in Civil 3D it's the first time I'm working.&lt;/SPAN&gt; &lt;SPAN&gt;I don't know Civil's methods, objects and entities and I'm learning.&lt;/SPAN&gt; &lt;SPAN class=""&gt;I thought the Developer's Guide could give me a notion but I'm seeing that I need to study further.&lt;/SPAN&gt; &lt;SPAN class=""&gt;Thanks for the help and sorry for your time wasted on me. Thank you very much&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 17:59:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9109346#M5113</guid>
      <dc:creator>sergiopedroza</dc:creator>
      <dc:date>2019-10-25T17:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Runtime Error in VBA Code</title>
      <link>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9109353#M5114</link>
      <description>&lt;P&gt;No Problem.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 18:02:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/runtime-error-in-vba-code/m-p/9109353#M5114</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2019-10-25T18:02:31Z</dc:date>
    </item>
  </channel>
</rss>

