POST
|
Thanks for the response, there is an error when the code runs: esri__CalResult = 20 * esri__63 / 0,4857 any suggestions?? 0,4857? Are you sure you don't want 0.4857?
... View more
06-16-2010
07:07 AM
|
0
|
0
|
346
|
POST
|
This is untested and I've not really worked with the Calculator much (if at all), but you could try the following: Instead of, 'here is when the code crash
'.Expression = " FM5 * [POBLACION] / FrmPerdida.txt_FM4.Text" Try, . Expression = FM5 & " * [POBLACION] / " & FM4
... View more
06-16-2010
06:35 AM
|
0
|
0
|
346
|
POST
|
Hi, I am running a check routine on a big (oracle based) SDE database (100K's of entries in dozends of tables) and create new Pointfeatures with some additional Field entries according to that check. I am using an InsertCursor for storing new features, because I've read that it can perform better than the FeaturClass.CreateFeature() / Feature.Store() aproach. However, it seems that my featureclass has some "complex" properties, as calling InsertCursor.InsertFeature() takes about 500 milliseconds for each point. Having to create about 30K Points, this results in a processing time of at least 6 hours, and that's just for storing the features, the check takes some time itself... Does anyone have an idea on how to speed up the process? Maybe a direct method of writing new Rows into the Featureclasses' Table might speed up the whole thing... I'm afraid I don't have much oracle know how, is there a simple way to accomplish such an insert operation with some c# code? You could try an IFeatureBuffer. After you create the FeatureClass, you can then set your IFeatureBuffer to this empty FC, as well as implement the IFeatureCursor. You'd do something like the following (this is JUST a snipit from a larger set of code used to create and populate a new FeatureClass from an ADO.NET DataTable): Dim pFeatCur As IFeatureCursor
Dim pFeatBuf As IFeatureBuffer
pFeatBuf = pFeatureClass.CreateFeatureBuffer
pFeatCur = pFeatureClass.Insert(True)
'*Add the new point
tmpPoint = New ESRI.ArcGIS.Geometry.Point
tmpPoint.PutCoords((CDec(row.Item("longitude"))), CDec(row.Item("latitude")))
'*Set the new point to match Projected CoordSys of SDE FeatureClass'
pGeo = tmpPoint
pGeo.SpatialReference = pSpRefWGS
pGeo.Project(pSpRefNAD83)
'*Create a point
pGeo.SnapToSpatialReference()
pFeatBuf.Shape = pGeo
pFeatCur.InsertFeature(pFeatBuf)
... View more
06-16-2010
04:51 AM
|
0
|
0
|
856
|
POST
|
Hi prahlad1981, I tried it but the same problem, what can I do?? Thanks for your assistance It looks like you have a typo in "esr iViewDrawPhase". Also, in my implementation (an ICommand .dll which works for ArcMap) I am using esriViewGeography instead. You can try this by replacing, AxPageLayoutControl1.ActiveView.PartialRefresh(esr iViewDrawPhase.esriViewGeoSelection, Nothing, Nothing) with, AxPageLayoutControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, Nothing, Nothing)
... View more
06-07-2010
05:34 AM
|
0
|
0
|
955
|
POST
|
Hi, Thanks for your reply. Even i m new to Programming arcobjects in python. It would be great if you provide me a simple vb/vb.net code using Arcobjects interfaces (like IWorkspacefactory, IFeatureWorkspace), which implements IGPFunctionfactory, which will help me to make similar changes to my code, compile it as DLL and add the object to ESRI Geoprocessing Function Factory catogory, so that i need not spend much time converting my code to python. Regards, Balaji. See if this helps: http://resources.arcgis.com/content/kbase?fa=articleShow&d=31110 I've not done ANY of this type of integration with Python/Geoprocesseor, so I'm not going to be a good source. But just doing a quick search at the EDN site shows quite a bit of discussion on this topic. It seems the logical approach is to build your GP tools, add them to the ToolBox, then execute/access these custom GPtools from the IGpDispatch interface. Good luck!
... View more
06-05-2010
10:00 AM
|
0
|
0
|
693
|
POST
|
Which Database is SDE running? I have not done this, but I've seen threads discussing this topic and a solution for Oracle db's is to query All_objects data dictionary table, which apperantly has a "created" column. I'm not too familiar with these tables and you'd have to determine what is available. Edit: Are you sure you cannot get at the values thru the IMetadata interface? From an older thread that I have not tested: Dim pMetadata As IMetadata = pFClass
Dim pPSet As IPropertySet = pMetadata.Metadata
Dim vValues As Variant = pPSet.GetProperty("Esri/CreaDate") re: http://forums.esri.com/Thread.asp?c=93&f=993&t=103799
... View more
05-27-2010
02:56 PM
|
0
|
0
|
573
|
POST
|
Hello, I would like to insert the values of a row of an attribute table into an array. I know how to do this manually: Dim myArray() myArray= Array("21621", "21612", "21624", .....) But I was wondering if you can use a loop to get the values automatically (using VBA). Can anybody help? Thanks! Do you mean get the values of the features from a Layer that is loaded in the TOC of ArcMap? I don't work much with arrays, but try something like this (untested): Dim pLayer as IFeatureLayer = pMap.Layer(0) 'gets the first layer in the TOC
Dim pFSel as IFeatureSelection = pLayer
Dim pFCursor as IFeatureCursor
pFSel.SelectionSet.Search(Nothing, False, pFCursor)
Dim myArray() As Array = New Array
Dim i As Integer
i = 0
Dim pFeat as IFeature
pFeat = pFCursor.NextFeature
Dim valForArray As String
Do Until pFeat Is Nothing
valForArray = pFeat.Value(pFeat.Fields.FindField("TheFieldName"))
myArray.Insert(i + 1, valForArray)
pFeat = pFCursor.NextFeature
Loop
... View more
05-27-2010
10:55 AM
|
0
|
0
|
433
|
POST
|
Just a follow up with the solution to this issue... Kirk, thanks again for the comments. Before I had set off to pursue the info you provided, I was thinking this had to be a much more basic problem that has a very simple solution. It does. So, I tried one other thing (not sure why I missed it before): The KeyUp Event of the Masked TextBox control. For whatever reason, the KeyPress and KeyDown events do not recognize the Return/Enter key --- they DO fire, but just not for THAT particular key stroke. So this issue is resolved quite simply by this: Private Sub txtPIDSearch_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtPIDSearch.KeyUp
Try
If e.KeyValue = Keys.Enter Then
'do something
End If
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub Thanks again for your input, I appreciate it. Take Care, j Thanks for the tip, Kirk... I'll continue down this route as this is the only info I've been able to acquire regarding this! Thank You!!!
... View more
05-27-2010
08:32 AM
|
0
|
0
|
560
|
POST
|
hi jamesfreddyc im using Arcmap i want to add new layer or save the new map as a tiff file. it doesnt matter. the important thing is that i want to give the user the ability to crop the map and save it as a file. i really appreciate ur help thank you I have not attempted to implement this functionality, but here's a sample from ArcGIS v9.0 that would probably work for you... http://edndoc.esri.com/arcobjects/9.2/CPP_VB6_VBA_VCPP_Doc/COM_Samples_Docs/Cartography/Printing_and_Exporting/9102B53F-B2C7-493C-92E6-46CD127F83B8.htm
... View more
05-25-2010
09:21 AM
|
0
|
0
|
546
|
POST
|
guys, any clue, hint or link is much appreciated What is the application type (ArcEngine, ArcServer, ArcMap)? I can probably give some help regarding numbers 1-3, but I don't understand what you want to do with #4 at all.
... View more
05-24-2010
01:11 PM
|
0
|
0
|
546
|
POST
|
Here is the full code for the function and form load, I want to get the featureclass name and concatenate it with a string: Use .AliasName of the FeatureClass to access the name. So in the portion of your code you supplied, just setup a string variable and set it to the .aliasname, which you can then use to concatenate. Dim pFClassName As String
Dim pFeatureclass As IFeatureClass
pFeatureclass = pFeatureworkspace.OpenFeatureClass(pclass)
pFClassName = pFeatureClass.AliasName Now you can use pFClassName in your concatenation: Dim SomeOtherVariableStringValue As String
Dim ConcatenatedStr As String = pFClassName & "_" & SomeOtherVariableStringValue
... View more
05-24-2010
05:23 AM
|
0
|
0
|
232
|
POST
|
Hi James, Thanks for your reply the code works but I have another problem I want towant to concatenate a string with a featureclass name I try gov = String.Concat(govlist, "_dist") but it displays "not found table name" You will have to provide the exact code you are trying to implement. I cannot tell what it is you are attempting from the code snippet you provided. Do you need to get the String value of the FeatureClass's name?
... View more
05-23-2010
06:20 AM
|
0
|
0
|
232
|
POST
|
Untested and I cannot remember exactly, but I think you need something like this: Set pFeatureLayer = New FeatureLayer
Set pFeatureLayer.FeatureClass = pFeatureClass So in the click event that sends the pFeatureLayer to your Sort_Unique Sub, you can try to set your pFeatureLayer as below. (You'll have to test this as I am away from my dev workstation and just going off of a guess): Private Sub Fill_Dist_List_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Fill_Dist_List.Click
Dim pGDBWSF As IWorkspaceFactory
pGDBWSF = New FileGDBWorkspaceFactory
Dim pWorkSpace As IWorkspace
pWorkSpace = pGDBWSF.OpenFromFile("E:\ArcGis Engine Projects\Data Layers\SDE GDB\sde_gdb.gdb", 0)
Dim pEnumDataset As IEnumDataset
pEnumDataset = pWorkSpace.Datasets(esriDatasetType.esriDTFeatureDataset)
Dim pDataset As IDataset
pDataset = pEnumDataset.Next
Dim FCN As String
FCN = Gov_List.SelectedText
Dim pFeatureworkspace As IFeatureWorkspace
pFeatureworkspace = pGDBWSF.OpenFromFile("E:\ArcGis Engine Projects\Data Layers\SDE GDB\sde_gdb.gdb", 0)
Dim pFeatureclass As IFeatureClass
pFeatureclass = pFeatureworkspace.OpenFeatureClass("amman_dist")
Dim pFeaturelayer As IFeatureLayer = New FeautureLayer
pFeaturelayer.FeatureClass = pFeatureclass
Dim Fieldname As String
Fieldname = "DIST_NA"
Dim pQFilter As IQueryFilter
pQFilter = New QueryFilter
pQFilter.WhereClause = "DIST_NA = 'ا�?جا�?عة' OR DIST_NA = 'ا�?ج�?زة' OR DIST_NA = 'ا�?ج�?ز�?' OR DIST_NA 'ا�?�?�?�?س�?�?'"
Sort_Unique(pFeatureclass, Fieldname, pQFilter)
End Sub Thanks alot
... View more
05-23-2010
03:56 AM
|
0
|
0
|
593
|
POST
|
I'm having a heck of a time with this C# code. Normally not a problem for me, but I'm just more comfortable in VB.NET and cannot seem to understand a couple of things you are attempting -- maybe someone with more C# exp can chime in. I don't understand where you are doing here (aside from the obvious of adding fields). What I mean is you are looping thru the fields of pFeatureLayer, then re-adding all of the existing fields back to it (minus the startswith/endswith)? Or do you just want to remove fields that match your string test? The other thing you mention is... takes a fraction of a second doing the same operation in the attribute table of the layer directly Can you just not attempt this? Not sure what the difference would be between the FeatureLayer and setting an ITable to the FLayer and running your code on it. I am unsure if that'd work or help.
... View more
05-22-2010
05:59 AM
|
0
|
0
|
350
|
POST
|
http://resources.esri.com/arcgisdesktop/dotnet/index.cfm Has walk-thru's and just about everything you'll need to get going. Good Luck!
... View more
05-22-2010
05:43 AM
|
0
|
0
|
214
|
Title | Kudos | Posted |
---|---|---|
1 | 10-25-2022 11:46 AM | |
1 | 08-08-2022 01:40 PM | |
1 | 02-15-2019 08:21 AM | |
2 | 08-14-2023 07:14 AM | |
1 | 07-10-2023 01:25 PM |
Online Status |
Offline
|
Date Last Visited |
08-19-2024
09:15 PM
|