<?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 add schematic diagram to MXD in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-add-schematic-diagram-to-mxd/m-p/706417#M54733</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been working my way through options to try not to do what you've suggested but I've not been able to find an alternative that works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MakeFeatureLayer doesn't appear to support Schematic Datasets and gives an error using arcpy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can't update the data source on a Schematic Dataset using arcpy tools.&amp;nbsp; Top note in the 'known limitations' section.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/updatingandfixingdatasources.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/updatingandfixingdatasources.htm"&gt;Updating and fixing data sources with arcpy.mapping—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been considering trying to make one schematic that I keep overwriting so that I only need one mxd, or having 1000 mxd files but those sound terrible and painful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm going to implement the idea you mentioned above.&amp;nbsp; I'm going to export my schematic to a temporary geodatabase and use that to create a grid on top of, generate my pdf series for that schematic #with Data Driven pages, then move on to the next schematic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;schematics&amp;nbsp;ddp data driven pages&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 Jan 2019 18:04:21 GMT</pubDate>
    <dc:creator>TimDine</dc:creator>
    <dc:date>2019-01-25T18:04:21Z</dc:date>
    <item>
      <title>Arcpy add schematic diagram to MXD</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-add-schematic-diagram-to-mxd/m-p/706415#M54731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need a python script that I can use to create a schematic diagram, and add it to an mxd. This must be done in an independent script and I cannot do it in arcmap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is I can't get arcpy to add the diagram layer to the map. I run&amp;nbsp;arcpy.schematics.CreateDiagram to create the diagram and that works, but when I try to use&amp;nbsp;arcpy.mapping.AddLayer to add the return from the diagram it throws an&amp;nbsp;AssertionError. I have also tried to use&amp;nbsp;arcpy.mapping.Layer but that throws the same error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone PLEASE tell me how to add a schematic diagram to an MXD with arcpy?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2018 14:06:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-add-schematic-diagram-to-mxd/m-p/706415#M54731</guid>
      <dc:creator>DonovonSimpson2</dc:creator>
      <dc:date>2018-02-19T14:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy add schematic diagram to MXD</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-add-schematic-diagram-to-mxd/m-p/706416#M54732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had to deal with the same requirement and I ended up to convert the diagram to features which results in feature classes in a feature dataset. You can easily add these feature classes to the MXD then. You need a template-MXD with the correct symbology for all layers, because the symbology is lost when converting the diagrams to features. You can then programatically switch the data sources from the template-MXD to point to the converted feature classes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/tools/schematics-toolbox/convert-diagram-to-features.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/tools/schematics-toolbox/convert-diagram-to-features.htm"&gt;Convert Diagram To Features—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to export the map/layout to PDF/PNG and you have rotated symbols or label expressions, please note that you&amp;nbsp;might have to use python 32 bit and not 64 bit because of the following Bugs: BUG-000093736; BUG-000092016&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I know this is the only solution but if somebody knows another solution I'm happy to hear about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Feb 2018 15:30:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-add-schematic-diagram-to-mxd/m-p/706416#M54732</guid>
      <dc:creator>AlexanderKlausegger</dc:creator>
      <dc:date>2018-02-19T15:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy add schematic diagram to MXD</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-add-schematic-diagram-to-mxd/m-p/706417#M54733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been working my way through options to try not to do what you've suggested but I've not been able to find an alternative that works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MakeFeatureLayer doesn't appear to support Schematic Datasets and gives an error using arcpy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can't update the data source on a Schematic Dataset using arcpy tools.&amp;nbsp; Top note in the 'known limitations' section.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/updatingandfixingdatasources.htm" title="http://desktop.arcgis.com/en/arcmap/10.3/analyze/arcpy-mapping/updatingandfixingdatasources.htm"&gt;Updating and fixing data sources with arcpy.mapping—Help | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been considering trying to make one schematic that I keep overwriting so that I only need one mxd, or having 1000 mxd files but those sound terrible and painful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm going to implement the idea you mentioned above.&amp;nbsp; I'm going to export my schematic to a temporary geodatabase and use that to create a grid on top of, generate my pdf series for that schematic #with Data Driven pages, then move on to the next schematic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;schematics&amp;nbsp;ddp data driven pages&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Jan 2019 18:04:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-add-schematic-diagram-to-mxd/m-p/706417#M54733</guid>
      <dc:creator>TimDine</dc:creator>
      <dc:date>2019-01-25T18:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy add schematic diagram to MXD</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-add-schematic-diagram-to-mxd/m-p/706418#M54734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some slight changes to my process now that I've actually gotten something working, this keeps almost all the data created during the process.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Generate schematic start point and barrier feature classes (barriers can also be starts sometimes)&lt;/LI&gt;&lt;LI&gt;Generate a schematic for each start point stopping at each barrier (CreateDiagram_schematics)&lt;UL&gt;&lt;LI&gt;trace the start point without any barriers first, then use that to select by location which barriers you want to use.&amp;nbsp; Less barriers makes for a faster trace (TraceGeometricNetwork_management)&lt;/LI&gt;&lt;LI&gt;I had to copy out each of my linear features to a temp feature class (CopyFeatures_management) from my trace result (TraceGeometricNetwork_management) in order to use them in SelectLayerByLocation_management&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Loop through all schematic datasets and export those to a feature dataset (ConvertDiagram_schematics)&lt;/LI&gt;&lt;LI&gt;Loop through all the feature datasets&lt;UL&gt;&lt;LI&gt;using a template mxd, change the data source of each layer in the mxd.&amp;nbsp; Everything followed a naming pattern that allowed me to just replace the user defined schematic name in each feature class name / source. (layer.dataSource.replace)&lt;/LI&gt;&lt;LI&gt;refresh and export the Data Driven Pages in the mxd which had been configured when creating the template (mxd.dataDrivenPages.refresh() and mxd.dataDrivenPages.exportToPDF())&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Nice things I get from this are all of the feature classes and schematic diagrams continue to exist after the bulk process.&amp;nbsp; You could open or update them individually if you wanted to make a one off.&amp;nbsp; You could let this data structure live forever and next time through just update instead of create everything from scratch.&amp;nbsp; I haven't saved out individual mxd files yet after repointing the data, but that could be done.&amp;nbsp; This process is being used to automate generating 900-1000 diagrams.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2019 21:43:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-add-schematic-diagram-to-mxd/m-p/706418#M54734</guid>
      <dc:creator>TimDine</dc:creator>
      <dc:date>2019-01-29T21:43:46Z</dc:date>
    </item>
  </channel>
</rss>

