|
POST
|
Hi, I have a feature class without version and archiving. When I attempt the code below, it threw a workspace already in transaction mode error. I tested with all combination of edit.startEditing(True/False,True/False) With and without startOperation nothing works. the only thing however that did worked is using arcpy.InsertCursor instead of arcpy.da.InsertCursor def main():
try:
edit = arcpy.da.Editor(workspace)
edit.startEditing(False, False)
edit.startOperation()
point = arcpy.Point(111,-60)
pointGeom = arcpy.PointGeometry(point,"4326")
row = []
row.append('test')
row.append(pointGeom)
cursor = arcpy.da.InsertCursor(config.FC, ['testfield', 'SHAPE@XY'])
cursor.insertRow(row)
edit.stopOperation()
edit.stopEditing(True)
except Exception as e:
#error handling
The following also did not work I would like to roll back if an error occurred during a truncate and append. I tested with DeleteFeature, neither worked. with arcpy.da.Editor(workspace) as edit:
arcpy.TruncateTable_management(config.PropertyFC)
#arcpy.DeleteFeatures_management(config.PropertyFC)
arcpy.Append_management(config.PropertyGDB, config.PropertyFC,"TEST") Can someone advise? Thanks
... View more
02-13-2020
05:13 PM
|
0
|
3
|
1742
|
|
POST
|
Hi, I have a piece of code that worked in 2.3 but failed in 2.4 with the following error, Method not found at ArcGIS.Desktop.Core.ClipboardItem.get_ItemInfoValue(). Everything compile fine and I can confirm the following code public ItemInfoValue ItemInfoValue { get; set; } in the ClipboardItem class. My Pro SDK version is 2.4.0.19948. I check the ArcGIS.Desktop.Core reference -> C:\Program Files\ArcGIS\Pro\bin\Extensions\Core\ArcGIS.Desktop.Core.dll which points to my ArcGIS pro 2.4 install. I am wondering if I have a mismatch in reference against pro somehow. I have also tried clean/rebuild. Any advise is much appreciated. if (dropInfo.Data is List<ClipboardItem> clipboardItems)
{
foreach (var item in clipboardItems)
{
var thisItem = item;
data_path = thisItem.ItemInfoValue.catalogPath;//thisItem.CatalogPath;
}
}
... View more
01-12-2020
05:29 PM
|
0
|
3
|
1048
|
|
POST
|
Hi Michael Reither, I have tested it with a domain account with a password that doesn't contain special character, only letters(caps and non caps) + numbers. Still getting the same error. However, running the optimizer.exe with the test.bat works great Traceback (most recent call last): File "ArcSOCOptimizer.py", line 11, in main File "Modules\Outputs\ReportBuilder.py", line 15, in __init__ File "Modules\Outputs\OutputBuilder.py", line 20, in __init__ File "Modules\ServiceStats\AGSAdmin.py", line 29, in __init__ ValueError: token error Traceback (most recent call last): File "ArcSOCOptimizer.py", line 11, in main File "Modules\Outputs\ReportBuilder.py", line 15, in __init__ File "Modules\Outputs\OutputBuilder.py", line 20, in __init__ File "Modules\ServiceStats\AGSAdmin.py", line 29, in __init__ ValueError: token error
... View more
12-17-2019
05:53 PM
|
0
|
0
|
1438
|
|
POST
|
Thank you Michael for your feedback. I will give that a try.
... View more
12-17-2019
04:49 PM
|
0
|
0
|
1438
|
|
POST
|
Just a update, Running the optimizer bypassing the webadaptor yield Traceback (most recent call last): File "ArcSOCOptimizer.py", line 11, in main File "Modules\Outputs\ReportBuilder.py", line 15, in __init__ File "Modules\Outputs\OutputBuilder.py", line 20, in __init__ File "Modules\ServiceStats\AGSAdmin.py", line 29, in __init__ ValueError: token error Traceback (most recent call last): File "ArcSOCOptimizer.py", line 11, in main File "Modules\Outputs\ReportBuilder.py", line 15, in __init__ File "Modules\Outputs\OutputBuilder.py", line 20, in __init__ File "Modules\ServiceStats\AGSAdmin.py", line 29, in __init__ ValueError: token error However running it with Test.bat returned something more promising. I only just setup the counter bypassing the webadaptor. i will wait a day and test again. However it is as simple as that. __GetPercentCommittedBytesInUseMax 78 __GetLogicalCoresMin 4 list index out of range Traceback (most recent call last): File "ArcSOCOptimizer.py", line 11, in main File "Modules\Outputs\ReportBuilder.py", line 22, in __init__ File "Modules\Outputs\ReportBuilder.py", line 69, in __Write IndexError: list index out of range None Traceback (most recent call last): File "ArcSOCOptimizer.py", line 11, in main File "Modules\Outputs\ReportBuilder.py", line 22, in __init__ File "Modules\Outputs\ReportBuilder.py", line 69, in __Write IndexError: list index out of range
... View more
12-16-2019
10:20 PM
|
0
|
3
|
1438
|
|
POST
|
Hi, When I change the task to "edit" mode, I get the following error: Traceback (most recent call last): File "ArcSOCOptimizer.py", line 11, in main File "Modules\Outputs\ReportBuilder.py", line 15, in __init__ File "Modules\Outputs\OutputBuilder.py", line 20, in __init__ File "Modules\ServiceStats\AGSAdmin.py", line 18, in __init__ TypeError: argument of type 'NoneType' is not iterable Traceback (most recent call last): File "ArcSOCOptimizer.py", line 11, in main File "Modules\Outputs\ReportBuilder.py", line 15, in __init__ File "Modules\Outputs\OutputBuilder.py", line 20, in __init__ File "Modules\ServiceStats\AGSAdmin.py", line 18, in __init__ TypeError: argument of type 'NoneType' is not iterable I have checked the following SiteUrl and tokenUrl matches ArcGIS Counter and optimizer ArcGIS Monitor credential i use the default user: Site (tested the login and it works) Also confirm credentials are the same for the counter and optimizer. Tested without adaptor but still fail running test.bat list mode works fine Edit mode I get: Error while fetching tokens from admin URL. Please check the URL and try again. argument of type 'NoneType' is not iterable Traceback (most recent call last): Environmenet is enterprise 10.5.1 ArcGIS Monitor : 10.6.1 Thank you in advance
... View more
12-16-2019
09:57 PM
|
0
|
5
|
1656
|
|
POST
|
{
"Time": {
"fromDate": "Now",
"timeZone": "US/Pacific",
"pastDays": 1,
"workDays": [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday" ],
"workHours": [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 ]
},
"SLA" : {
"ArcSOCSLA": 200,
"processesComment" : "http://support.esri.com/technical-article/000001218",
"MemFreeSLA(GB)": 4,
"arcSOCGB": 0.25
},
"LowUsageGroup": {
"usageSecLT": 20,
"minInstancesPerNode": 1,
"maxInstancesPerNode": 2,
"execute": "False"
},
"StandardUsageGroup": {
"maxInstancesPerNodeIncrement": 2,
"minStat": "p95",
"maxStat": "max",
"execute": "True"
},
"Exclude": {
"excludeAGSServices": [],
"excludeAGSFolders": [ "Utilities", "System", "Hosted" ]
},
"Email": {
"email": "False",
"server": "mail.xx.com",
"port": 25,
"user": "",
"password": "",
"sender": "sender@xx.com",
"receiverList": "user1@xx.com,user2@xx.com"
}
} Hi, can I asking why does the report suggest minNew to be 0 even when I have set the mininstancePerNode = 0. Also in the report, what does execute=false/true mean? Can I also confirm if MemFreeSLA == total memory on server - MemFreeSLA. E.g 32G ram - 4G == 28G Hence if server resource exceed 28 G, it will limit the ArcSOC instances? See report image attached
... View more
12-08-2019
11:11 PM
|
0
|
1
|
1384
|
|
POST
|
Thanks Uma, Might be the environment I am working on. There must be something funky going on in the background as my sde connection seem to point to a temporary sde conn as I am positive that is not the right sde connection. Name Value Type layer.GetFeatureClass().GetDatastore().GetPath().AbsolutePath "C:/Users/XXXXX/AppData/Local/Temp/5/ArcGISPro22300/f169296daa50ef0d20200577ae327cf5.sde" string
... View more
11-13-2019
05:28 PM
|
0
|
1
|
1676
|
|
POST
|
Hi Uma, thats great if dropInfo.Data is List<ClipboardItem> clipboardItems however what if if it is a mapMember or layer? var mm = dropInfo.GetTOCContent();//extension method - returns all MapMembers being dropped
//get just feature layers, for example
var layers = dropInfo.GetTOCContentOfType<FeatureLayer>() I tried with the following: layers[0].getFeatureClass().getDataStore().getPath() however I get a funny temporary sde connection in my temp folder. Thanks in advance
... View more
11-12-2019
05:38 PM
|
0
|
3
|
1676
|
|
POST
|
Hi, Following Uma Harano code on Drag & Drop into a DockPane , I am attempting to get the name and catalogue path of the payload that have been drag from the content pane. if it possible to get the full catalogue path to the item selected? Thanks
... View more
11-12-2019
12:01 AM
|
0
|
5
|
1798
|
|
POST
|
Sean Jones thanks for that. However that did not work and the UI thread is still hanging. Thanks
... View more
10-07-2019
07:22 PM
|
0
|
0
|
1873
|
|
POST
|
Hi, ProGuide TableControl · Esri/arcgis-pro-sdk Wiki · GitHub I am following this guide. On click of a button, I am attempting to change a attribute value and then save that value in the featureClass and update the tableControl. However, the save seem to be locking the UI thread and the table doesn't updated, the refresh icon just keeps spinning. If I close the pane and open it again, the table is updated. I have to use featureclass not not featurelayer as the layer I am updating most likely will not be added to the active map. Would anyone be able to advise? public ICommand AddToMapCommand
{
get
{
if (_addToMapCommand == null)
{
_addToMapCommand = new RelayCommand(() =>
{
//var oid = _tableControl.GetObjectIdAsync(_tableControl.ActiveRowIndex).Result;
QueuedTask.Run(() =>
{
IReadOnlyList<long> oids = _tableControl.GetSeletedObjectIds();
using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri(@"D:\SDE connection\LEA-304867.sde"))))
{
using (FeatureClass featClass = geodatabase.OpenDataset<FeatureClass>("arcgis.DBO.polygonfeaturelayer"))
{
EditOperation editOperation = new EditOperation();
editOperation.Callback(context => {
QueryFilter queryFilter = new QueryFilter
{
ObjectIDs = oids
};
using (RowCursor cursor = featClass.Search(queryFilter, false))
{
while (cursor.MoveNext())
{
using (Feature f = (Feature)cursor.Current)
{
f["NAME"] = "Y";
f.Store();
}
}
}
}, featClass);
bool success = editOperation.Execute();
if (success)
{
Project.Current.SaveEditsAsync();
this._tableControl.Refresh();
}
if (!success) throw new Exception(editOperation.ErrorMessage);
}
}
});
});
}
return _addToMapCommand;
}
}
... View more
10-06-2019
07:38 PM
|
0
|
3
|
2063
|
|
POST
|
Hi Narelle Chedzey, you are right as well. I tested it on 2.4.2 and it is working. Thanks
... View more
10-06-2019
07:33 PM
|
0
|
0
|
1201
|
|
POST
|
Hi, can anyone advise on what is the the proper way to call GetSeletedObjectIds on TableControl. Following the guide on the link below, I have attempted to run GetSeletedObjectIds on both TableControlDockpaneViewModel and TableControlDockpaneView in QueueTask.run. Both resulted in throwing an exception ""The calling thread cannot access this object because a different thread owns it" ProGuide TableControl · Esri/arcgis-pro-sdk Wiki · GitHub if (_addToMapCommand == null)
{
_addToMapCommand = new RelayCommand(() =>
{
QueuedTask.Run(() =>
{
try
{
var test = _tableControl.GetSeletedObjectIds().ToString();
}catch(Exception e)
{
return;
}
return;
});
});
} Thanks
... View more
10-02-2019
10:01 PM
|
0
|
3
|
1284
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-23-2021 06:05 AM | |
| 1 | 04-24-2020 01:46 AM | |
| 1 | 03-29-2022 06:53 PM | |
| 1 | 07-22-2021 07:59 PM | |
| 1 | 03-30-2022 04:36 PM |
| Online Status |
Offline
|
| Date Last Visited |
03-30-2022
06:13 PM
|