<?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: create attachments with scripts in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468712#M15744</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don't know if this question has been answered.&amp;nbsp; In order to avoid data duplication, is it possible to have images stored in their original location outside the attachment feature class and just have the attachment records created as pointers to the original data? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This way you would not have the original data and then a copy of the data in the attachment feature class.&amp;nbsp; It seems like this is what quite a few people are actually looking for.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Nov 2013 15:59:17 GMT</pubDate>
    <dc:creator>MichaelVolz</dc:creator>
    <dc:date>2013-11-07T15:59:17Z</dc:date>
    <item>
      <title>create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468691#M15723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was wondering if it is possible to attach several pictures to a set of points using scripts. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have different point locations (structures) and many jpgs for each structure. I would like to have an automated attachment process in which by clicking the point, the point will already know which pictures to show. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I already tried using the attachment manager in ArcMap10. However, my supervisor wants to make it an automated process. Does anybody know how to do this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Dec 2010 16:33:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468691#M15723</guid>
      <dc:creator>LauraTellechea</dc:creator>
      <dc:date>2010-12-03T16:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468692#M15724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;This isn't currently something you can do with scripting. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From what I understand you can control and work with attachments using ArcObjects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You could write something with native ArcObjects, or you could conceivably use Python and ArcObjects together to accomplish this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Attachments via Python/Arcpy is something we're looking at for the next release. However, at this time no promises, its just under consideration.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Dec 2010 19:01:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468692#M15724</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2010-12-03T19:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468693#M15725</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Actually I was just made aware that you can do this if you have the Data Interoperability extension.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is mention of it here around slide 18:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://proceedings.esri.com/dvd/uc/2010/uc-index/uc/workshops/tw_557.pdf"&gt;http://proceedings.esri.com/dvd/uc/2010/uc-index/uc/workshops/tw_557.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry, I couldn't find this presentation on the video channel. I'm not sure if it exists in video form.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 14:44:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468693#M15725</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2010-12-06T14:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468694#M15726</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Laura, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We are looking at an implementation of this for the next release of the software and are working on user requirements for the new tools. We would be interested in knowing how you would like to see this tool work?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Specifically, how would you like to see the association between an individual feature and attachment take place in an automated process?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Dec 2010 14:47:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468694#M15726</guid>
      <dc:creator>RussellBrennan</dc:creator>
      <dc:date>2010-12-06T14:47:35Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468695#M15727</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I would like to see this possible.&amp;nbsp; We want to use this in several locations in our County GIS environment. I have thousands of utility inspection reports that i would like to autoload into a feature class as individual attachments to a specific feature.&amp;nbsp; We also have site plands, and dozens of othre types of documents that we would like to load and be able to access thru map services by various end users within the county.&amp;nbsp; All told I have about 5TB (yes Terabyte) of .pdfs that need to be accessed by endusers to support their job functions.&amp;nbsp; to do this I have tables that relate my .pdf's to a specific feature. I just need a process to autoload them into the attachment tables within an .sde&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please consider this a high priority in your next update.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Elee&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Feb 2011 14:21:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468695#M15727</guid>
      <dc:creator>Dr__EleeDumas</dc:creator>
      <dc:date>2011-02-18T14:21:05Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468696#M15728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Elee, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do your attachments have any type of 'key value/key field' that would associate them to the record in the feature class or table you want to attach to?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example: Does the name of the utility inspection reports have some sort of unique id that would be able to be related to the actual infrastructure record in the feature class? Perhaps you have a unique feature ID that you use to name the inspection reports?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently in ArcGIS 10, we have a manual option through ArcGIS Desktop for adding attachments one record at a time. We looking at methods for attaching multiple attachments to multiple records in a batch operation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Feb 2011 14:34:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468696#M15728</guid>
      <dc:creator>RussellBrennan</dc:creator>
      <dc:date>2011-02-18T14:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468697#M15729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there a way to edit the attachment once it is created?&amp;nbsp; I am thinking a text document.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Apr 2011 13:08:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468697#M15729</guid>
      <dc:creator>CaseyBentz</dc:creator>
      <dc:date>2011-04-20T13:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468698#M15730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes I have this issue I have ~7000 sign post pictures of our highway network and a GDB with a signs layer. The unique photo file reference is named in a Photo column in the data but all I have is a file full of photos. I dont want to have to upload each picture to each asset is ther a way of loading the lot into the GDB and then pointing / configuring the software to pull up the correct photo based upon the unique id?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 May 2011 11:57:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468698#M15730</guid>
      <dc:creator>richardBurdett</dc:creator>
      <dc:date>2011-05-05T11:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468699#M15731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Yes I have this issue I have ~7000 sign post pictures of our highway network and a GDB with a signs layer. The unique photo file reference is named in a Photo column in the data but all I have is a file full of photos. I dont want to have to upload each picture to each asset is ther a way of loading the lot into the GDB and then pointing / configuring the software to pull up the correct photo based upon the unique id?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Richard, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the next release of ArcGIS we are looking at adding a geoprocessing tool that would give you the ability to use a key field to match a record in your table/feature class with a file stored on disk. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For example if you had a feature class containing sign posts with a photoID of 'sign1234' and you had a photo on disk named 'sign1234.jpg' you could attach photos based on this type of relationship. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Would these tools be useful with the way your data is currently stored?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 May 2011 16:43:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468699#M15731</guid>
      <dc:creator>RussellBrennan</dc:creator>
      <dc:date>2011-05-10T16:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468700#M15732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Would these tools be useful with the way your data is currently stored?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Russel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not the original poster, but I will state that the functionality that you have described would be very useful.&amp;nbsp; I'd like to be able to attach documents to a file geodatabase feature class using ArcToolbox tools or python scripts.&amp;nbsp; My ultimate goal is to expose the attach file functionality through a geoprocessing service in ArcGIS Server.&amp;nbsp; That way, users could add attachments to features by way of a web mapping application.&amp;nbsp; This can currently be done very easily if your data is in SDE.&amp;nbsp; I'd like to use a file geodatabase for my applications...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 May 2011 19:28:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468700#M15732</guid>
      <dc:creator>KenMorefield</dc:creator>
      <dc:date>2011-05-27T19:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468701#M15733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Instead of attaching the actual document to each feature and storing it in the geodatabase, is it possible to only store the LINK or PATH to the file in the geodatabase?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a street feature class that i am attaching hundreds of as built .pdf documents to.&amp;nbsp; Because the geodatabase stores the actual file..it is getting very large very quickly.&amp;nbsp; And it's redundant because the files are already stored on the server.&amp;nbsp; The attachment feature is key because many of our users have arcgisexplorer and can view the documents as html pop ups from there.&amp;nbsp; However, I am running out of space!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Each street segment has a unique segment number but the as built documents are randomly numbered.&amp;nbsp; I have an access table that stores the segment number and it associated "asbuilt ID's" but they are not the same number.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be VERY useful if we could just attach several "hyperlinks" to a feature and have those links stored in the geodatabase.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this currently possbile or will it be in future releases?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And I hope this makes sense to all of you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Sep 2011 15:50:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468701#M15733</guid>
      <dc:creator>BrennaSterling</dc:creator>
      <dc:date>2011-09-27T15:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468702#M15734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Russel,&lt;BR /&gt;I'm not the original poster, but I will state that the functionality that you have described would be very useful.&amp;nbsp; I'd like to be able to attach documents to a file geodatabase feature class using ArcToolbox tools or python scripts.&amp;nbsp; My ultimate goal is to expose the attach file functionality through a geoprocessing service in ArcGIS Server.&amp;nbsp; That way, users could add attachments to features by way of a web mapping application.&amp;nbsp; This can currently be done very easily if your data is in SDE.&amp;nbsp; I'd like to use a file geodatabase for my applications...&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I am trying to accomplish the very same task. This would be very useful for my operation, as well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Oct 2011 13:11:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468702#M15734</guid>
      <dc:creator>RebeccaRidley</dc:creator>
      <dc:date>2011-10-06T13:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468703#M15735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I was challenged with the same issue, so here's some psuedo code that may help.&amp;nbsp;&amp;nbsp; Using the active layer, in an Edit session, this code will loop through a featureclass reading a value from a Filepath field.&amp;nbsp;&amp;nbsp; Most people already have a column like this in their data, particularly if they use Hyperlinks.&amp;nbsp; If the filepath value is not null, the associated file is loaded as an attachment for that feature.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Dim pApplication As IApplication
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxDocument As IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatLayer As IFeatureLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatureclass As IFeatureClass
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pTable As ITable
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pContentsView As IContentsView3
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pfeature As IFeature
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatCursor As IFeatureCursor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim OID As Integer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim filepath As String

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pApplication = m_application
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMxDocument = pApplication.Document
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pContentsView = pMxDocument.CurrentContentsView

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim selectedItem As System.Object = pContentsView.SelectedItem
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not (TypeOf selectedItem Is ESRI.ArcGIS.Carto.ILayer) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return
&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; Dim layer As ESRI.ArcGIS.Carto.ILayer = TryCast(selectedItem, ESRI.ArcGIS.Carto.ILayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeatLayer = TryCast(layer, ESRI.ArcGIS.Carto.FeatureLayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeatureclass = pFeatLayer.FeatureClass

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim tableAttachments As ITableAttachments = CType(pFeatureclass, ITableAttachments)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim attachmentManager As IAttachmentManager = tableAttachments.AttachmentManager


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTable = pFeatLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeatCursor = pFeatureclass.Search(Nothing, False)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pfeature = pFeatCursor.NextFeature()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do While Not pfeature Is Nothing

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OID = pfeature.OID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filepath = pfeature.Value(pfeature.Fields.FindField("FilePath"))&amp;nbsp; 'the field where you store the filename

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not filepath.Equals("999") 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; ' Open a file as a memory blob stream.
&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; Dim memoryBlobStream As IMemoryBlobStream = New MemoryBlobStreamClass()
&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; memoryBlobStream.LoadFromFile(filepath)

&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; ' Create an attachment.
&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; Dim attachment As IAttachment = New AttachmentClass With _
&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;&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;&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;&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;&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;&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; .ContentType = "image/jpeg", _
&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;&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;&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; .Data = memoryBlobStream, _
&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;&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;&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; .Name = filepath _
&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;&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;&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;&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; ' Assign the attachment to the feature with ObjectID (OID) = 1.
&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; attachmentManager.AddAttachment(OID, attachment)

&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; pfeature.Store()
&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; pfeature = pFeatCursor.NextFeature

&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;&amp;nbsp; pfeature = pFeatCursor.NextFeature()
&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; Loop

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeatCursor = Nothing&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:46:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468703#M15735</guid>
      <dc:creator>EdDempsey</dc:creator>
      <dc:date>2021-12-11T20:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468704#M15736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I was challenged with the same issue, so here's some psuedo code that may help.&amp;nbsp;&amp;nbsp; Using the active layer, in an Edit session, this code will loop through a featureclass reading a value from a Filepath field.&amp;nbsp;&amp;nbsp; Most people already have a column like this in their data, particularly if they use Hyperlinks.&amp;nbsp; If the filepath value is not null, the associated file is loaded as an attachment for that feature.&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;PRE class="lia-code-sample line-numbers language-none"&gt;Dim pApplication As IApplication
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pMxDocument As IMxDocument
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatLayer As IFeatureLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatureclass As IFeatureClass
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pTable As ITable
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pContentsView As IContentsView3
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pfeature As IFeature
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim pFeatCursor As IFeatureCursor
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim OID As Integer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim filepath As String

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pApplication = m_application
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pMxDocument = pApplication.Document
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pContentsView = pMxDocument.CurrentContentsView

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim selectedItem As System.Object = pContentsView.SelectedItem
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not (TypeOf selectedItem Is ESRI.ArcGIS.Carto.ILayer) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Return
&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; Dim layer As ESRI.ArcGIS.Carto.ILayer = TryCast(selectedItem, ESRI.ArcGIS.Carto.ILayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeatLayer = TryCast(layer, ESRI.ArcGIS.Carto.FeatureLayer)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeatureclass = pFeatLayer.FeatureClass

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim tableAttachments As ITableAttachments = CType(pFeatureclass, ITableAttachments)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim attachmentManager As IAttachmentManager = tableAttachments.AttachmentManager


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pTable = pFeatLayer
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeatCursor = pFeatureclass.Search(Nothing, False)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pfeature = pFeatCursor.NextFeature()

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do While Not pfeature Is Nothing

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OID = pfeature.OID
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; filepath = pfeature.Value(pfeature.Fields.FindField("FilePath"))&amp;nbsp; 'the field where you store the filename

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not filepath.Equals("999") 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; ' Open a file as a memory blob stream.
&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; Dim memoryBlobStream As IMemoryBlobStream = New MemoryBlobStreamClass()
&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; memoryBlobStream.LoadFromFile(filepath)

&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; ' Create an attachment.
&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; Dim attachment As IAttachment = New AttachmentClass With _
&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;&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;&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;&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;&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;&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; .ContentType = "image/jpeg", _
&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;&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;&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; .Data = memoryBlobStream, _
&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;&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;&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; .Name = filepath _
&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;&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;&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;&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; ' Assign the attachment to the feature with ObjectID (OID) = 1.
&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; attachmentManager.AddAttachment(OID, attachment)

&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; pfeature.Store()
&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; pfeature = pFeatCursor.NextFeature

&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;&amp;nbsp; pfeature = pFeatCursor.NextFeature()
&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; Loop

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pFeatCursor = Nothing&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is going to sound stupid but did you use VBA to run this code? I'm trying to avoid VBA now since it will be no longer supported in future releases.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:46:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468704#M15736</guid>
      <dc:creator>AdamCottrell</dc:creator>
      <dc:date>2021-12-11T20:46:46Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468705#M15737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Richard, &lt;BR /&gt;&lt;BR /&gt;In the next release of ArcGIS we are looking at adding a geoprocessing tool that would give you the ability to use a key field to match a record in your table/feature class with a file stored on disk. &lt;BR /&gt;&lt;BR /&gt;For example if you had a feature class containing sign posts with a photoID of 'sign1234' and you had a photo on disk named 'sign1234.jpg' you could attach photos based on this type of relationship. &lt;BR /&gt;&lt;BR /&gt;Would these tools be useful with the way your data is currently stored?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes thats it! that would be perfect! Please hurry as this would be Indispensable to me!.&amp;nbsp;&amp;nbsp; Many thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jun 2012 11:47:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468705#M15737</guid>
      <dc:creator>richardBurdett</dc:creator>
      <dc:date>2012-06-21T11:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468706#M15738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Yes thats it! that would be perfect! Please hurry as this would be Indispensable to me!.&amp;nbsp;&amp;nbsp; Many thanks!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is in ArcGIS 10.1, it will be shipping soon.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Working_with_the_Attachments_geoprocessing_tools/00170000017z000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/Working_with_the_Attachments_geoprocessing_tools/00170000017z000000/&lt;/A&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001700000157000000"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 20:56:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468706#M15738</guid>
      <dc:creator>RussellBrennan</dc:creator>
      <dc:date>2012-07-03T20:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468707#M15739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;ArcMap 10.1 Standard&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Windows 7 Professional&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;12.0 GB Ram&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;64 Bit&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to use the following Data Management Tools:&amp;nbsp; Attachments: "Generate Attachment Match Table" and "Add Attachments".&amp;nbsp; The "Generate Attachment Match Table" tool works perfectly, but my computer cannot seem to execute the "add attachments" command.&amp;nbsp; I tried reducing the size of the Match Table all the way down to three rows, but it still gets stuck.&amp;nbsp; Does anyone know what I am doing wrong?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 31 Jul 2012 17:17:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468707#M15739</guid>
      <dc:creator>RachelOser</dc:creator>
      <dc:date>2012-07-31T17:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468708#M15740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In answer to my own question, I was creating an INFO table.&amp;nbsp; When I put the output match table inside the geodatabase instead, everything worked great.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Aug 2012 12:21:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468708#M15740</guid>
      <dc:creator>RachelOser</dc:creator>
      <dc:date>2012-08-01T12:21:57Z</dc:date>
    </item>
    <item>
      <title>customize the path where I want to save the attachment</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468709#M15741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Instead of attaching the actual document to each feature and storing it in the geodatabase, is it possible to only store the LINK or PATH to the file in the geodatabase?&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;I have a street feature class that i am attaching hundreds of as built .pdf documents to.&amp;nbsp; Because the geodatabase stores the actual file..it is getting very large very quickly.&amp;nbsp; And it's redundant because the files are already stored on the server.&amp;nbsp; The attachment feature is key because many of our users have arcgisexplorer and can view the documents as html pop ups from there.&amp;nbsp; However, I am running out of space!&lt;BR /&gt;&lt;BR /&gt;Each street segment has a unique segment number but the as built documents are randomly numbered.&amp;nbsp; I have an access table that stores the segment number and it associated "asbuilt ID's" but they are not the same number.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;It would be VERY useful if we could just attach several "hyperlinks" to a feature and have those links stored in the geodatabase.&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;Is this currently possbile or will it be in future releases?&amp;nbsp; &lt;BR /&gt;&lt;BR /&gt;And I hope this makes sense to all of you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Someone found how to do this, I have the same problem, help please.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 16:59:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468709#M15741</guid>
      <dc:creator>AuraRamos_Lora</dc:creator>
      <dc:date>2012-12-06T16:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: create attachments with scripts</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468710#M15742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Richard, &lt;BR /&gt;&lt;BR /&gt;In the next release of ArcGIS we are looking at adding a geoprocessing tool that would give you the ability to use a key field to match a record in your table/feature class with a file stored on disk. &lt;BR /&gt;&lt;BR /&gt;For example if you had a feature class containing sign posts with a photoID of 'sign1234' and you had a photo on disk named 'sign1234.jpg' you could attach photos based on this type of relationship. &lt;BR /&gt;&lt;BR /&gt;Would these tools be useful with the way your data is currently stored?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This would be a great option, if designed correctly.&amp;nbsp; As is, if I have a 20 square signs called s_sign with photos s1.jpg, s2.jpg, s3.jpg, etc.&amp;nbsp; Would be nice if it used the key/value pair in the lookup table to do the relate.&amp;nbsp; Instead, it takes the OID from the FIRST occurance of the feature (squaresign) and will attach every photo to the first occurance of s_sign, and all other s_sign features have none.&amp;nbsp; Seems like it completely defeats the anything to many relationship.&amp;nbsp; Seems that if, instead of converting the key value to the first OID that matches and using the actual key value column for the relate would actually give us what it claims.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;R_&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Professional ESRI beta tester&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2013 15:41:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/create-attachments-with-scripts/m-p/468710#M15742</guid>
      <dc:creator>RhettZufelt</dc:creator>
      <dc:date>2013-01-09T15:41:32Z</dc:date>
    </item>
  </channel>
</rss>

