<?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: Is there a property for a feature class that shows if “Attachments” are enabled on that feature? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/is-there-a-property-for-a-feature-class-that-shows/m-p/1533358#M72767</link>
    <description>&lt;P&gt;I'd recommend always using standard attachment table name.&amp;nbsp; Then you can check if &amp;lt;FeatureClass OR Table&amp;gt; + '__ATTACH' arcpy.Exists.&lt;/P&gt;</description>
    <pubDate>Fri, 30 Aug 2024 14:28:05 GMT</pubDate>
    <dc:creator>DavidTillberg_community</dc:creator>
    <dc:date>2024-08-30T14:28:05Z</dc:date>
    <item>
      <title>Is there a property for a feature class that shows if “Attachments” are enabled on that feature?</title>
      <link>https://community.esri.com/t5/python-questions/is-there-a-property-for-a-feature-class-that-shows/m-p/359687#M28374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Hi, &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Am I missing something here is there a property for a feature class that shows if “Attachments” are enabled on that feature? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;I have located the following properties but can find anything for attachments &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;datasetVersioned = arcpy.Describe(fc).isVersioned&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;inc.wriInfo('{0:&amp;lt;50} Feauture Class/Table - Versioned = {1}'.format(fc, datasetVersioned))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;datasetArchived = arcpy.Describe(fc).IsArchived&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;inc.wriInfo('{0:&amp;lt;50} Feauture Class/Table - Archived = {1}'.format(fc, datasetArchived))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;editorTrackingEnabled = arcpy.Describe(fc).editorTrackingEnabled&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;inc.wriInfo('{0:&amp;lt;50} Feauture Class/Table - Tracking = {1}'.format(fc, editorTrackingEnabled))&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;I am trying to report multiple Geo database schemas with varying objects in multiple Oracle SDE databases. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Can anyone tell me what is the best way to find out if objects have “Attachments” associated with it using ArcPy? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;I could loop through all feature classes and see if there is an Attachment relationship class and an Attachment table but assume that there must be a better way then checking if there are Attachments enabled. &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Many thanks for any suggestions &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10.0pt;"&gt;Adrian&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 08:48:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-a-property-for-a-feature-class-that-shows/m-p/359687#M28374</guid>
      <dc:creator>AdrianGay</dc:creator>
      <dc:date>2019-07-30T08:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a property for a feature class that shows if “Attachments” are enabled on that feature?</title>
      <link>https://community.esri.com/t5/python-questions/is-there-a-property-for-a-feature-class-that-shows/m-p/359688#M28375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Adrian&lt;/P&gt;&lt;P&gt;I assume you are looking for something not on the list of functions or within the classes&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/functions/alphabetical-list-of-arcpy-functions.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/functions/alphabetical-list-of-arcpy-functions.htm"&gt;Alphabetical list of ArcPy functions—ArcPy Functions | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/classes/alphabetical-list-of-arcpy-classes.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/classes/alphabetical-list-of-arcpy-classes.htm"&gt;Alphabetical list of ArcPy classes—ArcPy classes | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Haven't seen one&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 09:15:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-a-property-for-a-feature-class-that-shows/m-p/359688#M28375</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-07-30T09:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a property for a feature class that shows if “Attachments” are enabled on that feature?</title>
      <link>https://community.esri.com/t5/python-questions/is-there-a-property-for-a-feature-class-that-shows/m-p/359689#M28376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you assume correctly...&amp;nbsp;&lt;/P&gt;&lt;P&gt;At the moment the only solution that I can see is to loop over the feature classes by name and then see if there is&amp;nbsp;also a&lt;/P&gt;&lt;P&gt;SDE&amp;nbsp;Relationship Class of the form [NAME]_ATTACHEREL and a&amp;nbsp;&lt;/P&gt;&lt;P&gt;SDE Table of the form&amp;nbsp;&lt;SPAN&gt;[NAME]_ATTACH&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But my assumption (which may be incorrect) is that there must be a better way from Esri to do this and to see if "Attachments" are enabled on an object.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 09:41:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-a-property-for-a-feature-class-that-shows/m-p/359689#M28376</guid>
      <dc:creator>AdrianGay</dc:creator>
      <dc:date>2019-07-30T09:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a property for a feature class that shows if “Attachments” are enabled on that feature?</title>
      <link>https://community.esri.com/t5/python-questions/is-there-a-property-for-a-feature-class-that-shows/m-p/1533358#M72767</link>
      <description>&lt;P&gt;I'd recommend always using standard attachment table name.&amp;nbsp; Then you can check if &amp;lt;FeatureClass OR Table&amp;gt; + '__ATTACH' arcpy.Exists.&lt;/P&gt;</description>
      <pubDate>Fri, 30 Aug 2024 14:28:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-a-property-for-a-feature-class-that-shows/m-p/1533358#M72767</guid>
      <dc:creator>DavidTillberg_community</dc:creator>
      <dc:date>2024-08-30T14:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a property for a feature class that shows if “Attachments” are enabled on that feature?</title>
      <link>https://community.esri.com/t5/python-questions/is-there-a-property-for-a-feature-class-that-shows/m-p/1576044#M73576</link>
      <description>&lt;P&gt;Here's another way to achieve this using essentially a one liner.&lt;/P&gt;&lt;P&gt;Using the Data Access describe ensures we have a dictionary and can use the 'get' method to provide a fallback of an empty list if the relationshipClassNames key doesn't exist.&lt;/P&gt;&lt;P&gt;The code iterates over the strings in the relationshipClassNames list and checks if any match the baseName of the featureclass with '__ATTACHREL' at the end which indicates attachments are enabled.&lt;/P&gt;&lt;P&gt;The python 'any' keyword returns true if any of the strings match and false if none do.&lt;/P&gt;&lt;P&gt;This should therefore return true if there are attachments and false if not. It's essentially the same as previously suggested code, but some people prefer one liners and some prefer multiline if/else statements as more readable. Take your pick&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;desc = arcpy.da.Describe(feature_class)
hasAttachments = any(value == f'{desc.get('baseName', '||')}__ATTACHREL' for value in desc.get('relationshipClassNames', []))&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 15 Jan 2025 23:00:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/is-there-a-property-for-a-feature-class-that-shows/m-p/1576044#M73576</guid>
      <dc:creator>PaulHaakma</dc:creator>
      <dc:date>2025-01-15T23:00:32Z</dc:date>
    </item>
  </channel>
</rss>

