<?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: Need help with the script in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528426#M41384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;error messages are also required, just copy and paste them&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Mar 2015 22:20:20 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2015-03-17T22:20:20Z</dc:date>
    <item>
      <title>Need help with the script</title>
      <link>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528424#M41382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create file geodatabase and create a mosaic dataset; however I do know that creating a file geodatabase works but the mosaic dataset is not...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think there must be a way to force the dataset within the file geodatabase but it is blocking me ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at my codes &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;################################################################################
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CREATE FILE GEODATABASE AND THEN CREATE MOSAIC DATASET&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #
################################################################################


# Name: CreateFileGDB_Example2.py
# Description: Create a file GDB


# Import system modules
import arcpy


# Set local variables
out_folder_path = "C:/workspace"
out_name = "test.gdb"


# Execute CreateFileGDB
Test = arcpy.CreateFileGDB_management(out_folder_path, out_name)


# Creating new Mosaic Dataset within Existing File Geodatbase
# Set NAD 1983 UTM Zone 13N
sr =&amp;nbsp; arcpy.SpatialReference(26913)


mdname = "/SeeIfThisWorks"


try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; # To see if the file exists or not
&amp;nbsp;&amp;nbsp;&amp;nbsp; Test = arcpy.CreateFileGDB_management(out_folder_path, out_name)
&amp;nbsp;&amp;nbsp;&amp;nbsp; #Then create the file
&amp;nbsp;&amp;nbsp;&amp;nbsp; mdname= arcpy.CreateMosaicDataset_management(out_folder_path,Test,mdname)
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; str = "Your Mosaic Dataset" +str2+"" "is done created"
&amp;nbsp;&amp;nbsp;&amp;nbsp; str2 = "Test"
&amp;nbsp;&amp;nbsp;&amp;nbsp; print str + str2&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:00:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528424#M41382</guid>
      <dc:creator>DEAF_PROBERT_68</dc:creator>
      <dc:date>2021-12-11T23:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the script</title>
      <link>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528425#M41383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can resolve your problem with this code by reading the &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000008n000000"&gt;help&lt;/A&gt; for this tool. Look at the syntax section in the help file, the parameters in your code are incorrect for the CreateMosaicDataset tool. If you actually scroll to the bottom of the help file you'll see a sample of code using the tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It's all the help file...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 22:14:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528425#M41383</guid>
      <dc:creator>DuncanHornby</dc:creator>
      <dc:date>2015-03-17T22:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the script</title>
      <link>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528426#M41384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;error messages are also required, just copy and paste them&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2015 22:20:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528426#M41384</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-03-17T22:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the script</title>
      <link>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528427#M41385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try following changes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Import arcpy, os&lt;/P&gt;&lt;P&gt;2. mdname = "SeeIfThisWorks"&lt;/P&gt;&lt;P&gt;3. mdname= arcpy.CreateMosaicDataset_management(os.path.join(out_folder_path,Test),mdname)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is helpful&lt;/P&gt;&lt;P&gt;Kishor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 06:53:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528427#M41385</guid>
      <dc:creator>KishorGhatage</dc:creator>
      <dc:date>2015-03-18T06:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the script</title>
      <link>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528428#M41386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As Duncan already pointed out, the help page lists the required parameters (there are THREE of them).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Mar 2015 07:02:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528428#M41386</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-03-18T07:02:16Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the script</title>
      <link>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528429#M41387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why do you create the geodatabase twice? (in line 20 and line 33)&amp;nbsp; You should create it once.&amp;nbsp; It could be the source of your error&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also your try/except block is wrong.&amp;nbsp; Within the try section, you attempt to do the work...that is fine...&amp;nbsp; Your except block is supposed to provide you with what to do when the try block DOES NOT WORK, you have it reporting that the try block was successful, and not a dismal failure.&lt;/P&gt;&lt;P&gt;So try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy
arcpy.env.overwriteOutput = True
.... code stuff in preparation for try/except block
try:
&amp;nbsp; 'do magic'
except:
&amp;nbsp; 'when magic fails ... do this '
&amp;nbsp; print " failed again....sigh...."&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;replacing 'do magic' and 'when magic fails ... do this '&amp;nbsp; with appropriate code.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:00:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528429#M41387</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T23:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need help with the script</title>
      <link>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528430#M41388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good news !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While I have been figuring it out and looking at the help on this problem..Sigh It is been battle back and forth for me . The problem is in the Creating Mosaic Dataset..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works ! I have made a lot of change from the original code I post yesterday... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had to copy the code from this &lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-weight: bold;"&gt;reateMosaicDataset example 2 (stand-alone script)&amp;nbsp; &lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000008n000000" title="http://resources.arcgis.com/en/help/main/10.1/index.html#//00170000008n000000" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcGIS Help 10.1&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-weight: bold;"&gt;it was giving several problems.... the prjfile does not work...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;so I add the the SpatialReference with WKID in it &lt;/P&gt;&lt;P&gt;and make sure the code in one line..example see 26&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;

################################################################################
#&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CREATE FILE GEODATABASE AND THEN CREATE MOSAIC DATASET&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #
################################################################################


# Name: CreateFileGDB_Example2.py
# Description: Create a file GDB


# Import system modules
import arcpy,os,sys


arcpy.env.workspace = "C:/workspace"


# Set local variables
out_folder_path = "C:/workspace"
out_name = "Think.gdb"


# Execute CreateFileGDB
arcpy.CreateFileGDB_management(out_folder_path, out_name)


# Creating new Mosaic Dataset within Existing File Geodatbase




try:
&amp;nbsp;&amp;nbsp;&amp;nbsp; gdbname = "Think.gdb"
&amp;nbsp;&amp;nbsp;&amp;nbsp; mdname = "SeeIfThisWorks"
&amp;nbsp;&amp;nbsp;&amp;nbsp; prjfile = arcpy.SpatialReference(26913)
&amp;nbsp;&amp;nbsp;&amp;nbsp; noband = "3"
&amp;nbsp;&amp;nbsp;&amp;nbsp; pixtype = "8_BIT_UNSIGNED"
&amp;nbsp;&amp;nbsp;&amp;nbsp; pdef = "NONE"
&amp;nbsp;&amp;nbsp;&amp;nbsp; wavelength = ""
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CreateMosaicDataset_management(gdbname, mdname, prjfile, noband,pixtype, pdef, wavelength)
except:
&amp;nbsp;&amp;nbsp;&amp;nbsp; print "Create Mosaic Dataset failed"&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:00:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/need-help-with-the-script/m-p/528430#M41388</guid>
      <dc:creator>DEAF_PROBERT_68</dc:creator>
      <dc:date>2021-12-11T23:00:52Z</dc:date>
    </item>
  </channel>
</rss>

