<?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 VBA Script to add data to attribute table afte drawing a line in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/vba-script-to-add-data-to-attribute-table-afte/m-p/210372#M5461</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am looking for a VBA script that I can use so that I can draw a line as part of a shapefile file and then have a wondow with predefined fields pop up so the user can enter data into an attribute table.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example.&amp;nbsp; I draw a line representing roads.&amp;nbsp; Once I have drawn in the box would pop up asking for the road name, road number and towns.&amp;nbsp; These would be fields that already exist in the attibute table. The data entered in the window would, once OK was pressed be entered into the row associated with that line drawn.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any parts of this you have would be useful.&amp;nbsp; even just the calling of a box once a line has been drawn.&amp;nbsp; This is similar to the NOAA habitat digitiser tool that calls a box once a polygon has been drawn.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 17 Jun 2010 08:27:53 GMT</pubDate>
    <dc:creator>NicholasGeorge</dc:creator>
    <dc:date>2010-06-17T08:27:53Z</dc:date>
    <item>
      <title>VBA Script to add data to attribute table afte drawing a line</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vba-script-to-add-data-to-attribute-table-afte/m-p/210372#M5461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am looking for a VBA script that I can use so that I can draw a line as part of a shapefile file and then have a wondow with predefined fields pop up so the user can enter data into an attribute table.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example.&amp;nbsp; I draw a line representing roads.&amp;nbsp; Once I have drawn in the box would pop up asking for the road name, road number and towns.&amp;nbsp; These would be fields that already exist in the attibute table. The data entered in the window would, once OK was pressed be entered into the row associated with that line drawn.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any parts of this you have would be useful.&amp;nbsp; even just the calling of a box once a line has been drawn.&amp;nbsp; This is similar to the NOAA habitat digitiser tool that calls a box once a polygon has been drawn.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jun 2010 08:27:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vba-script-to-add-data-to-attribute-table-afte/m-p/210372#M5461</guid>
      <dc:creator>NicholasGeorge</dc:creator>
      <dc:date>2010-06-17T08:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Script to add data to attribute table afte drawing a line</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/vba-script-to-add-data-to-attribute-table-afte/m-p/210373#M5462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello&lt;BR /&gt;&lt;BR /&gt;I am looking for a VBA script that I can use so that I can draw a line as part of a shapefile file and then have a wondow with predefined fields pop up so the user can enter data into an attribute table.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;For example.&amp;nbsp; I draw a line representing roads.&amp;nbsp; Once I have drawn in the box would pop up asking for the road name, road number and towns.&amp;nbsp; These would be fields that already exist in the attibute table. The data entered in the window would, once OK was pressed be entered into the row associated with that line drawn.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;Any parts of this you have would be useful.&amp;nbsp; even just the calling of a box once a line has been drawn.&amp;nbsp; This is similar to the NOAA habitat digitiser tool that calls a box once a polygon has been drawn.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the most basic/generic sense, you would first, create a UserForm with controls to allow for data entry.&amp;nbsp; These controls could be whatever best represents the fields in the table/attributes, such as textbox controls.&amp;nbsp; Then I'd set an EditEvents and utililze the OnSketchFinished event to launch the UserForm and allow the user to enter the data into the controls.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Look into the IEditor Inteface for more info.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Private pEditor As ESRI.ArcGIS.Editor.IEditor
Private WithEvents m_pEditEvents As ESRI.ArcGIS.Editor.Editor


Private Sub m_pEditEvents_OnSketchFinished() Handles m_pEditEvents.OnSketchFinished
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pDoc As IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pDoc = m_pApp.Document
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pActiveView As IActiveView = pDoc.ActiveView

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'If an edit session has not already been started, exit
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If pEditor.EditState = ESRI.ArcGIS.Editor.esriEditState.esriStateNotEditing Then 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'do something
&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'stop editing
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pEditor.StopEditing((True))

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(ex.ToString)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try
&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:22:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/vba-script-to-add-data-to-attribute-table-afte/m-p/210373#M5462</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-11T10:22:37Z</dc:date>
    </item>
  </channel>
</rss>

