<?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: ArcPY Create Check Out Replica in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-create-check-out-replica/m-p/125118#M9743</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I came up with a solution for this:&amp;nbsp; using an idea from &lt;A href="https://community.esri.com/people/jskinner-esristaff"&gt;jskinner-esristaff&lt;/A&gt;&amp;nbsp; posted a few years ago (&lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/message/226898?commentID=226898#comment-226898" title="https://community.esri.com/message/226898?commentID=226898#comment-226898"&gt;https://community.esri.com/message/226898?commentID=226898#comment-226898&lt;/A&gt;&amp;nbsp;) I create an in_memory polygon feature based on the extent of (the zoomed in) view of my mxd.&amp;nbsp; Big fun!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Once again, thanks Jake!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Oct 2017 20:51:14 GMT</pubDate>
    <dc:creator>JoeBorgione</dc:creator>
    <dc:date>2017-10-12T20:51:14Z</dc:date>
    <item>
      <title>ArcPY Create Check Out Replica</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-create-check-out-replica/m-p/125117#M9742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When using the Distributed Database Tool Bar to create a Check Out replica, you are given the option to specify the extent of the data you have chosen to replicate.&amp;nbsp; &amp;nbsp;In the on line help (&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/create-replica.htm" title="http://desktop.arcgis.com/en/arcmap/latest/tools/data-management-toolbox/create-replica.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;Create Replica—Help | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;) it gives an indication that you can provide an extent as well:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/379692_pastedImage_158.png" style="width: 620px; height: 71px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following the online help as a template, I have created a python script to create a check out replica. I'm developing it with just one feature class in the mxd, (the parent data) and I zoom to an area of interest to create a replica of just a few features.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, if I include the parent geometry&amp;nbsp;as&amp;nbsp;the extent argument, no resulting feature class replica is created&amp;nbsp;but the script runs just fine, no errors.&amp;nbsp; &amp;nbsp;If I leave that argument off, a resulting feature class and replica&amp;nbsp;are created; only problem is it's the entire feature class which is not what I want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code from on line help (formatted as python):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;in_data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Parks"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# a feature dataset &lt;/SPAN&gt;
replica_type &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"ONE_WAY_REPLICA"&lt;/SPAN&gt; 
output_workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"C:\Data\MyTargetGDB.gdb"&lt;/SPAN&gt;
replica_name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MyReplica"&lt;/SPAN&gt; 
access_type &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"FULL"&lt;/SPAN&gt; 
initial_sender &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"PARENT_DATA_SENDER"&lt;/SPAN&gt; 
expand &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"USE_DEFAULTS"&lt;/SPAN&gt; 
reuse_schema &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DO_NOT_REUSE"&lt;/SPAN&gt; 
get_related &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GET_RELATED"&lt;/SPAN&gt; 
replica_geometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"LA_County"&lt;/SPAN&gt; 
archiving &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DO_NOT_USE_ARCHIVING"&lt;/SPAN&gt; 
&lt;SPAN class="comment token"&gt;# Execute CreateReplica arcpy.CreateReplica_management(in_data, replica_type, output_workspace, replica_name, access_type, initial_sender, expand, reuse_schema, get_related, replica_geometry, archiving)‍‍‍‍‍‍‍‍‍‍‍‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't set the archiving variable so mine is slightly different; I also create a directory and subsequent fileg dbd to write the replica feature class to.&amp;nbsp; The idea here is once the edits are complete, a second script will fire off, syncing the replica back to the parent (and thus getting rid of the the replica itself) and then remove the directory and file gdb to be re-created next time:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;path &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\temp"&lt;/SPAN&gt; 
os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mkdir&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="comment token"&gt;### new directory will be deleted later&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateFileGDB_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Replicas.gdb"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="comment token"&gt;### new child geodatabase; gets deleted later...&lt;/SPAN&gt;
output_workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;"C:\temp\Replicas.gdb"&lt;/SPAN&gt;
in_data &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"slcogis.GDB_ADD.MasterStreetNameFC"&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#sde point feature class&lt;/SPAN&gt;
replica_type &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"CHECK_OUT"&lt;/SPAN&gt;
replica_name &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"MyReplica"&lt;/SPAN&gt;
access_type &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"FULL"&lt;/SPAN&gt;
initial_sender &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"PARENT_DATA_SENDER"&lt;/SPAN&gt;
expand &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"USE_DEFAULTS"&lt;/SPAN&gt;
reuse_schema &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"DO_NOT_REUSE"&lt;/SPAN&gt;
get_related &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"GET_RELATED"&lt;/SPAN&gt;
replica_geometry &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"slcogis.GDB_ADD.MasterStreetNameFC"&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;### this is the parent, but zoomed in....&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CreateReplica_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_data&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; replica_type&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; output_workspace&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; replica_name&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; access_type&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; initial_sender&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; expand&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; reuse_schema&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; get_related&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;replica_geometry&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is actually a script that an ArcPY addin will control with a button click, as will the the one that checks in the child and subsequently deletes the workspace.&amp;nbsp;&amp;nbsp;I'm not sure (and neither are any of my colleagues) why it's not honoring the&amp;nbsp;preferred extent.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:08:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-create-check-out-replica/m-p/125117#M9742</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T07:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: ArcPY Create Check Out Replica</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-create-check-out-replica/m-p/125118#M9743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I came up with a solution for this:&amp;nbsp; using an idea from &lt;A href="https://community.esri.com/people/jskinner-esristaff"&gt;jskinner-esristaff&lt;/A&gt;&amp;nbsp; posted a few years ago (&lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/message/226898?commentID=226898#comment-226898" title="https://community.esri.com/message/226898?commentID=226898#comment-226898"&gt;https://community.esri.com/message/226898?commentID=226898#comment-226898&lt;/A&gt;&amp;nbsp;) I create an in_memory polygon feature based on the extent of (the zoomed in) view of my mxd.&amp;nbsp; Big fun!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(Once again, thanks Jake!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Oct 2017 20:51:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-create-check-out-replica/m-p/125118#M9743</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2017-10-12T20:51:14Z</dc:date>
    </item>
  </channel>
</rss>

