|
POST
|
Here is a solution I found on here many years ago, which I cannot find now. This is for ArcMap. import arcpy, os
from arcpy import env
env.overwriteOutput = True
# Get arguments:
# Input point feature class
# Output polygon feature class
# Buffer distance
# Boolean type: Maintain fields and field values of the input in the output
print "initializing"
inPoints = arcpy.GetParameterAsText(0) # Feature Class
outPath = arcpy.GetParameterAsText(1) # Folder
outName = arcpy.GetParameterAsText(2) # Variant
buf1 = float(arcpy.GetParameterAsText(3)) # String
buf2 = float(arcpy.GetParameterAsText(4)) # String
bufDist1 = buf1/2
bufDist2 = buf2/2
outPolys = outPath+"//"+outName+".shp"
print "creating new blank feature"
arcpy.env.outputCoordinateSystem = arcpy.GetParameterAsText(5) # Coordinate System
arcpy.CreateFeatureclass_management(outPath, outName,"POLYGON","","","", "", "","","","")
print "created"
# Open searchcursor
inRows = arcpy.SearchCursor(inPoints)
# Open insertcursor
outRows = arcpy.InsertCursor(outPolys)
# Create point and array objects
pntObj = arcpy.Point()
arrayObj = arcpy.Array()
print "writing geomety"
for inRow in inRows: # One output feature for each input point feature
inShape = inRow.shape
pnt = inShape.getPart(0)
# Need 5 vertices for square buffer: upper right, upper left, lower left,
# lower right, upper right. Add and subtract distance from coordinates of
# input point as appropriate.
for vertex in [0,1,2,3,4]:
pntObj.ID = vertex
if vertex in [0,3,4]:
pntObj.X = pnt.X + bufDist1
else:
pntObj.X = pnt.X - bufDist1
if vertex in [0,1,5]:
pntObj.Y = pnt.Y + bufDist2
else:
pntObj.Y = pnt.Y - bufDist2
arrayObj.add(pntObj)
# Create new row for output feature
feat = outRows.newRow()
# Assign array of points to output feature
feat.shape = arrayObj
# Insert the feature
outRows.insertRow(feat)
# Clear array of points
arrayObj.removeAll()
# Delete inputcursor
del outRows
print "done"
... View more
03-20-2019
09:39 AM
|
1
|
0
|
4413
|
|
POST
|
Try this: for layer in layers:
if layer.getSelectionSet() > 0:
print layer
... View more
03-20-2019
08:05 AM
|
0
|
0
|
3067
|
|
POST
|
Yes you need to check it back in on the device it was checked out of. We had a computer broke and the only way to get the license back was through Esri Customer Service.
... View more
03-19-2019
11:21 AM
|
2
|
1
|
1858
|
|
POST
|
I just saw that you are new to this. First you cannot edit the layer directly from the Living Atlas. Right click the layer and export it. Next use the explode tool, this will break it into all individual features. Next select the two and Merge. I just did this on the same layer and it turns out there is a tiny gap between the two. For it to be seamless you need to draw a polygon over the gap, snapping to the boundaries, select the features and Merge.
... View more
03-19-2019
09:51 AM
|
2
|
2
|
3861
|
|
POST
|
Uma, I think I am narrowing it down, I went into the ArcGISPro.exe.config and changed to <supportedRuntime version="v4.0.30319" sku=".NETFramework,Version=v4.6.1"/> Now all the add-ins I built work great but the out of the box ones do not. I assume there is a setting in VS where I can set the framework version or write the correct one into the code somewhere? If you have any experience or knowledge in this area I would appreciate the help, I am at a loss when I have to start getting into the XML system files. ArcObjects Help for .NET developers https://gis.stackexchange.com/questions/13606/why-cant-the-breakpoint-be-hit-when-debugging-an-arcgis-10-add-in#16206
... View more
02-19-2019
02:13 PM
|
0
|
0
|
2099
|
|
POST
|
I renamed the root folders and reinstalled the software and it has helped a lot. Still a bit slow but manageable. using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ArcGIS.Core.Geometry;
using ArcGIS.Desktop.Mapping;
namespace MapToolSelect
{
internal class MapToolSelect : MapTool
{
public MapToolSelect()
{
IsSketchTool = true;
SketchType = SketchGeometryType.Rectangle;
SketchOutputMode = SketchOutputMode.Screen;
}
protected override Task OnToolActivateAsync(bool active)
{
return base.OnToolActivateAsync(active);
}
protected override Task<bool> OnSketchCompleteAsync(Geometry geometry)
{
return ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
// Using the active map view to select
// the features that intersect the sketch geometry
ActiveMapView.SelectFeatures(geometry);
return true;
});
}
}
}
... View more
02-19-2019
12:24 PM
|
0
|
0
|
2099
|
|
POST
|
Correct. Normal out of the box works fine. My custom code and the ESRI samples code downloaded from GitHub fails. Worked fine in 2.2.
... View more
02-19-2019
11:40 AM
|
0
|
3
|
2099
|
|
POST
|
No exception thrown. It sits and spins for 5-10 minutes, all others tools are grayed out, the refresh spins, and nothing gets selected. All features are in a sde database.
... View more
02-19-2019
11:18 AM
|
0
|
5
|
2099
|
|
POST
|
The process to select by using Sketch tools is not working in 2.3. I double checked to make sure it was not just my code by downloading a fresh set of the samples from here GitHub - Esri/arcgis-pro-sdk-community-samples: ArcGIS Pro SDK for Microsoft .NET Framework Community Samples and ran of the Feature Selection and the Map Tool Select without changing a thing and they both fail. Is there a known fix to this?
... View more
02-19-2019
10:22 AM
|
0
|
7
|
2581
|
|
POST
|
This worked, calling just the name of the feature class and not the whole path. I was wanting the default database. Thank you for sticking with me Rich!
... View more
01-22-2019
10:50 AM
|
1
|
0
|
4446
|
|
POST
|
This does not seem to successfully get a list of the feature class either, it returns the definitions but not the actual name. I cannot find any examples of doing this in the snippets or help either. Probably going to switch to python to do this task, but I would like to avoid that because python takes a lot longer to run.
... View more
01-22-2019
09:07 AM
|
0
|
3
|
4446
|
|
POST
|
Thanks Rich! I did mean feature class, I corrected the question. When I tried your suggestion I get the error "Non-invocable member ;FeatureClassDefinition' cannot be used like a method. Below is what I ended up trying, it runs without error, but it still does not see the feature class when it does exist. string projGDBPath = Project.Current.DefaultGeodatabasePath;
string FC = TXB.Text; // From a text box in the xaml
string fcFINAL = System.IO.Path.Combine(projGDBPath, FC);
await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => {
using (Geodatabase geodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(projGDBPath))))
{
try
{
FeatureClassDefinition featureClassDefinition = geodatabase.GetDefinition<FeatureClassDefinition>(fcFINAL);
featureClassDefinition.Dispose();
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("It exists");
}
catch
{
ArcGIS.Desktop.Framework.Dialogs.MessageBox.Show("It Does Not Exist");
}
}
});
... View more
01-22-2019
07:44 AM
|
0
|
5
|
4446
|
|
POST
|
Is there a way to see if a feature class exists in a file geodatabase OR loop through and get a list of all the feature class in a file geodatabase using the Pro SDK?
... View more
01-18-2019
12:43 PM
|
0
|
7
|
4876
|
|
POST
|
There really is no "migration" of add-ins from Desktop to Pro. It really is a completely different SDK, so no comparing apples to apples. This was the first question I asked when I took the Pro SDK class, hoping it would be a simple change of a couple things in my add-ins. Python is very similar in both, but the Pro SDK and ArcObjects are very different. Just dive in and start from scratch, it is not too difficult to pick up the Pro SDK. I had about a dozen add-ins to redo from Desktop to Pro and was able to find a way to replicate all them. Good Luck!
... View more
01-17-2019
07:12 AM
|
0
|
0
|
5655
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-23-2026 09:28 AM | |
| 2 | 05-21-2026 09:21 AM | |
| 1 | 05-19-2026 02:25 PM | |
| 1 | 05-19-2026 08:11 AM | |
| 1 | 04-17-2026 01:08 PM |
| Online Status |
Offline
|
| Date Last Visited |
05-28-2026
06:06 AM
|