|
POST
|
You will just need to add pythonaddins.Messagebox to the end of your code. Ex: import arcpy
import pythonaddins
class XYTool(object):
"""Implementation for xy_addin.XYTool (Tool)"""
def __init__(self):
self.enabled = True
self.cursor=3
def onMouseDownMap(self, x, y, button, shift):
mxd=arcpy.mapping.MapDocument("current")
df = arcpy.mapping.ListDataFrames(mxd)[0]
pt=arcpy.PointGeometry(arcpy.Point(x,y))
#ptfeat=arcpy.management.CopyFeatures(pt,r"in_memory\pt")
print x,y
pythonaddins.MessageBox(str(x) + ", " + str(y), 'Coordinates', 0)
... View more
01-18-2013
06:07 AM
|
0
|
0
|
3384
|
|
POST
|
The coordinates will be printed to your Python window. Open that window before executing the tool.
... View more
01-17-2013
06:48 AM
|
0
|
0
|
3384
|
|
POST
|
Hi Gregg, Under 'Syntax' take a look at the 'in_folder_type' option here.
... View more
01-17-2013
06:25 AM
|
0
|
0
|
844
|
|
POST
|
Hi Ruchi, You can do this using Python and the field calculator. Here is the syntax: !Annex_Date![-4:] Also, be sure 'Python' is checked at the top of the Field Calculator. [ATTACH=CONFIG]20728[/ATTACH]
... View more
01-15-2013
02:18 AM
|
0
|
0
|
1403
|
|
POST
|
This command will only update the layer specified with the '-l' option. In the example above, only the "airports" feature class extent will be updated.
... View more
01-15-2013
02:04 AM
|
0
|
0
|
2004
|
|
POST
|
You can use the 'sdelayer -o alter' command with the '-E' option to calculate the extent. Ex: sdelayer -o alter -l airports,shape -E calc -D gis -i sde:sqlserver:server -u vector -p vector For the '-E' option you can use 'calc' to automatically calculate the extent, or you can enter the extent manually, i.e. (-E -75.07,40.03,-74.98,40.10)
... View more
01-14-2013
02:37 AM
|
0
|
0
|
2004
|
|
POST
|
You would just need to add '+ ".jpg"' to the code. Ex: for name in list:
arcpy.MakeRasterLayer_management(r"C:\ArcGISProjects\SamplePhotos" + "\\" + name + ".jpg", name)
... View more
01-10-2013
12:57 PM
|
0
|
0
|
2829
|
|
POST
|
You can specify the specific data frame you want to add the raster to by using it's name in the following line: df = arcpy.mapping.ListDataFrames(mxd, "<data frame name>")[0] To use the names in the list, you could do something like: for name in list: arcpy.MakeRasterLayer_management(r"C:\ArcGISProjects\SamplePhotos" + "\\" + name, name)
... View more
01-10-2013
09:42 AM
|
0
|
0
|
2829
|
|
POST
|
Hi Megan, First, make a Raster Layer from the JPEG, and then use the AddLayer function to add the raster layer to the MXD. Ex: import arcpy
arcpy.MakeRasterLayer_management(r"C:\DATA\RASTER\JPG\barberspt.jpg", "BarbersPt")
mxd = arcpy.mapping.MapDocument(r"C:\Temp\Python\Harbour.mxd")
df = arcpy.mapping.ListDataFrames(mxd)[0]
addLayer = arcpy.mapping.Layer("BarbersPt")
arcpy.mapping.AddLayer(df, addLayer, "BOTTOM")
mxd.save()
del mxd
... View more
01-10-2013
01:40 AM
|
0
|
0
|
2829
|
|
POST
|
Can you send a screen shot of your connection properties from the client machine's ArcMap?
... View more
01-09-2013
01:32 AM
|
0
|
0
|
4153
|
|
POST
|
As a test, try creating a SQL Server Authenticated user to see if you can connect using a database user rather than a windows user. Steps for this can be found here. Before creating the user, make sure the SQL Server Express instance is configured to accept SQL Server and Windows Authentication. You can configure this by right-clicking on the instance in SQL Server Management Studio > Properties > Security > Server Authentication.
... View more
01-08-2013
01:34 AM
|
0
|
0
|
4153
|
|
POST
|
Hi Daniel, You won't have to compress to a state of 0, but a few things you will have to do: 1. If you have any replicas, synchronize each one. 2. Reconcile each other version. If you are using ArcGIS 10.1, you can see the other versions to reconcile and perform the reconciliation by looking at the Reconcile Order tab. 3. Make sure no other users are connected, this includes ArcGIS Server services. You can disconnect users at 10.1 as well. After the above criteria is met, you can compress the database, and the edits will be reflected in your Query Layer.
... View more
01-07-2013
11:33 AM
|
0
|
0
|
596
|
|
POST
|
Hi Yan, The map services are in different geographic areas. So, after you click the drop down button to show the other map service you will need to update the extent using the setExtent method. Ex: function createdropbutton()
{
var splitbutoon=new Ext.button.Split({
renderTo: "extSlider",
frame:true,
text:'�??换',
menu:new Ext.menu.Menu({
items: [
// these will render as dropdown menu items when the arrow is clicked:
{text: '影�?�', handler: function(){
// alert("Item 1 clicked");basemapGallery.select("basemap_0");}
Dbasemap1.setVisibility(true);
Ybasemap.setVisibility(false);
var originalExtent = new esri.geometry.Extent({"xmin":-86.309,"ymin":37.895,"xmax":-85.044,"ymax":38.515,"spatialReference":{"wkid":4326}});
map.setExtent(originalExtent);
}
},
{text: '�?�形', handler: function(){
//alert("Item 2 clicked");basemapGallery.select("basemap_1"); }
Dbasemap1.setVisibility(false);
Ybasemap.setVisibility(true);
var newExtent = new esri.geometry.Extent({"xmin":-80.466,"ymin":27.287,"xmax":-80.248,"ymax":27.536,"spatialReference":{"wkid":4326}});
map.setExtent(newExtent);
}
}
]
})
});
... View more
01-07-2013
06:14 AM
|
0
|
0
|
1141
|
|
POST
|
Hi David, Are the window's credentials you are logged in as on the Windows 7 client machine added to the SQL Server Express Instance on MyServer? You can check this by going to SQL Server Management Studio > Security folder > Logins. Also, take a look at the following article for some other possible solutions.
... View more
01-07-2013
03:31 AM
|
0
|
0
|
4154
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|