|
POST
|
Ola, Are you saying that when you toggle the layer's visibility off, you can still see the selected features? If so, then it might be that you need to do a full refresh on the ActiveView:
'This line would refresh the selection
pDoc.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, Nothing, Nothing)
'add this line to fully refresh the view
pDoc.ActiveView.Refresh()
... View more
10-10-2011
06:59 AM
|
0
|
0
|
3542
|
|
POST
|
After a bit more research, I have applied a fix that seems to work. Well, it DOES work to fix my problem however I am not completely certain of any extra side affects that it may cause --- as far as I can tell, there are none, but that doesn't mean this will apply to your situation. So please peform your own analysis before taking the same approach. Ok, so from what I can tell/understand, the .msi Installer is ignoring the main .dll when the re-installation is performed. Why it cannot determine if it need to be reinstalled I am not sure, but this seems to be the behavior. The solution is to set the REINSTALLMODE=amus property of the .msi --- you have to do this with an application called "Orca", which is downloaded from Microsoft. The amus property stands for these settings and applies them to the files in the .msi package: a - Force all files to be reinstalled, regardless of version. m - Rewrite all registry keys that go to HKEY_LOCAL_MACHINE or HKEY_CLASSES_ROOT. u - Rewrite all registry keys that go to HKEY_CURRENT_USER or HKEY_USERS. s - Reinstall shortcuts and icons. *This is why I say you will need to do your own analysis of this to determine if this would be a good solution for you because your scenario may contain shared files/folders that could be negatively affected by the amus property. Anyway -- that is my current solution.
... View more
10-10-2011
06:34 AM
|
0
|
0
|
1053
|
|
POST
|
Hi James, That seems to work fine, thanks! Cheers Ed Excellent! Take Care, james
... View more
10-10-2011
06:08 AM
|
0
|
0
|
873
|
|
POST
|
I can't seem to shake these COM installer/registration issues I've had over the last 6mo's or so, and this one is a little new/different this time. As the title suggests, I cannot seem to fully succeed at the whole process to properly install AND register my COM components that are packaged into a Setup project and deployed as the .msi to each user to install on their respective computers. ArcGIS v10 COM Component .dll/.tlb Implments ICommand/IToolBar (includes an IToolBarDef class too) First, let me say that an initial run of this built .msi works great! As long as there are no existing references to the .dll's being deployed. That is, if the install is done on a workstation that has not had the COM component installed, then it runs exactly as desired. So, with that said I am now attempting to re-deploy this COM component again because it contains some updates.... In the Setup Project/Assembly (by clicking directly on the project in the Solution Explorer), I have set RemovePreviousVersions = True and changed the Version as well (this automatically changes the ProductCode after clicking "Yes"). I then re-build the setup project. (note: I can go thru all of the other items like my InvokeESRIRegAsm.dll and the registration code I have in the ICommand/IToolBarDef classes, but again, the first go/run of this deployment works so I don't think there is anything wrong with these). (note2: I did set the Register property of the main .dll to vsdraDoNotRegister, but the .tbl is set to vsdrfCOM) Results: 1. If I simply copy the new .msi over to the target computer and run it, no errors and everything seems to install as desired. But the original COM Component (a Toolbar) remains the same and does not contain the updates. So, basically it doesn't seem to have registered. 2. If, after step 1. above I do nothing and re-step thru the process of adding the .tlb by way of Customize--> AddFromFile... then again, nothing seemingly goes wrong but the toolbar doesn't register again. 3. If prior to running the new .msi I go thru the process of manually unregistering the COM component by the Categories.exe, then removing the insalled component by way of the ControlPanel--> Add/Remove programs, then re-run the .msi ----- everything works as expected. In summary --- I can accomplish what I need by simply performing step #3 above. However, I do not have admin priv's and the install process is done throughout the organization by IT Department technicians and there are simply too many things to do for them to efficiently run the installations. I need a way to simply provide them with the new .msi, have them run it, the new COM component is up and running. Any insight, input or comments are greatly appreciated. James
... View more
10-10-2011
05:20 AM
|
0
|
4
|
3133
|
|
POST
|
In "Joining Data" in the help, the following code is given: // Build a memory relationship class. Type memRelClassFactoryType = Type.GetTypeFromProgID( "esriGeodatabase.MemoryRelationshipClassFactory"); IMemoryRelationshipClassFactory memRelClassFactory = (IMemoryRelationshipClassFactory)Activator.CreateInstance(memRelClassFactoryType) ; IRelationshipClass relationshipClass = memRelClassFactory.Open("ParcelsOwners", parcelsFeatureClass, "PARCEL_ID", (IObjectClass)ownersTable, "PARCEL_ID", "Is Owned By", "Owns", esriRelCardinality.esriRelCardinalityOneToOne); But no explanation is provided for "ownersTable." What is it? I have created a QueryClass that implements the ITable interface and can be successfully casted to an ITable but that ITable cannot be casted to IObjectClass. What can be? I think that you are attempting to Join the parcelsFeatureClass to the ownersTable in your code you posted. Is that what you want? Are you sure it shouldn't be the other way around? That is, you want to join the ownersTable to the parcelsFeatureClass. If so, it should be something like (this is VB.NET sorry):
pMemoryRelationshipClassFactory = New MemoryRelationshipClassFactory
pRelationshipClass = pMemoryRelationshipClassFactory.Open("Join", ownersTable, TableFieldForJoin, pFeatureLayer.DisplayFeatureClass, LayerFieldForJoin, "forward", "backward", esriRelCardinality.esriRelCardinalityOneToOne)
... View more
10-07-2011
09:41 AM
|
0
|
0
|
1281
|
|
POST
|
Hi: I need to parse both dynamic text and text formatting tags to get to the actual displayed text string. I couldn't find an ArcObjects method that does that. Has anybody developed such parser and if so how can I access it? I would expect that it would be based on Regular Expresssions (regex). I am using .NET. Thanks, Dennis Without knowing exactly what it is you are attempting to accomplish, here's a very simple example of how to use Regex. The result would be the MsgBox popup as "blah2". (also: you will need Imports System.Text.RegularExpressions)
Dim theString As String = "blah1 blah2 blah3"
Dim rx As New Regex("blah2(.*?)")
Dim matches As MatchCollection = rx.Matches(theString)
For Each match As Match In matches
Dim groups As GroupCollection = match.Groups
MsgBox("Found :" & groups.Item(0).Value() & groups.Item(1).Value)
Next Hope this helps!
... View more
10-07-2011
07:51 AM
|
0
|
0
|
866
|
|
POST
|
The * indicates a 3 digit number which will change each time. I can't work out whether the error is with my Case syntax or with the introduction of the wildcard. Help on both would be appreciated. Ed Ed, If the first 3 characters are what you are interested in searching, meaning that anything before the _underscore is what you want to match, then you could just set a new string variable to the first 3 characters and run your Select Case on that. This would mean that you are only looking to Select the first 3 chars (rather than attempting the wildcard, which I don't think will work). Something like this:
Dim AssetID_Val As String = "PG_123" 'this is manually set to test it out
Dim srchString As String = Mid(AssetID_Val, 1, 3)
Select Case srchString
Case "ND_"
MsgBox(AssetID_Val & " Found!")
Case "LK_"
MsgBox(AssetID_Val & " Found!")
Case "PG_"
MsgBox(AssetID_Val & " Found!")
Case Else
MsgBox("nothing found!")
End Select So, in the above example, the MsgBox would popup "PG_123 Found!" because the Select located that the first 3 characters in the AssetID_Val variable are "PG_". If the AssetID_Val was = "LK_888888", then the msgBox would popul with "LK_888888 Found". Hope this makes sense! Here's how your full implementation might look:
Dim srchString As String = Mid(AssetID_Val, 1, 3)
Select Case srchString
Case "ND_"
Set pStdAloneTbl = pMap2.StandaloneTable(0)
Case "LK_"
Set pStdAloneTbl = pMap2.StandaloneTable(1)
Case "PG_"
Set pStdAloneTbl = pMap2.StandaloneTable(2)
Case Else
MsgBox "Error"
pEditor.AbortOperation
Exit Sub
End Select
... View more
10-07-2011
07:14 AM
|
0
|
0
|
873
|
|
POST
|
Stuart, You will have to explain at what point these dynamic changes must occur. From what I can tell, the ComboBoxes are populated when the Toolbar loads, then at some point they are then repopulated. Are you having problems getting the CboBoxes to load on the first go? What action needs to occur for the ComboBox datasource to change? I don't see how simply gaining focus would be cause to change the control's datasource.
... View more
10-07-2011
04:49 AM
|
0
|
0
|
504
|
|
POST
|
Hi there Lauren, I was a little confused by your useage of the QueryFilterClass() as I am unsure if this goes along with the IMxDocument --- from what I see, it belongs with ArcMobile and or WebADF. Of course, I could be reading that incorrectly. Are you working with ArcMap for this? In any event, I've taken some snippets from similar functionality that I use for some ArcMap customizations and added to your existing code you posted. I pretty much left what you had, added to it and altered the WHERE clause portion (I noticed some minor syntax problems with what you had). Anyway -- let me know if this works! Take Care.
Dim pMXDoc As ESRI.ArcGIS.ArcMapUI.IMxDocument
pMXDoc = My.ArcMap.Document
Dim pMap As ESRI.ArcGIS.Carto.IMap
pMap = pMXDoc.FocusMap
Dim pFeatureLayer As ESRI.ArcGIS.Carto.IFeatureLayer
Dim pActiveView As ESRI.ArcGIS.Carto.IActiveView
pActiveView = pMap
Dim pFeatureSelection As ESRI.ArcGIS.Carto.IFeatureSelection
Dim LayerName As String
LayerName = "Cadastre - Parcels"
For i = 0 To pMap.LayerCount - 1
If UCase(pMap.Layer(i).Name.Trim()) = UCase(LayerName.Trim()) Then
pFeatureLayer = pMap.Layer(i)
Exit For
End If
Next
'Get attributes from the textboxes
Dim AttPlanNumber As String
Dim AttLotNumber As String
Dim SearchStatement As String
AttPlanNumber = txtDPNumber.Text
AttLotNumber = txtLotNumber.Text
pFeatureSelection = pFeatureLayer
'setup a QueryFilter and where clause
'If both Plan and Lot number MUST match, then use this
Dim str As String = "PLANNO = '" & AttPlanNumber & "' AND " & LOTNO = '" & AttLotNumber & "'"
'If either Plan or Lot number can match, then use this
Dim str As String = "PLANNO = '" & AttPlanNumber & "' OR " & LOTNO = '" & AttLotNumber & "'"
Dim pQueryFilter As IQueryFilter
pQueryFilter = New QueryFilter
pQueryFilter.WhereClause = str
pFeatureSelection.SelectFeatures(pQueryFilter, esriSelectionResultEnum.esriSelectionResultNew, False)
' Refresh the selection
pMxDoc.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, Nothing, Nothing)
'Zoom to the selected features
Dim pSelectionSet As ISelectionSet
pSelectionSet = pFeatureSelection.SelectionSet
Dim pEnumGeom As Geometry.IEnumGeometry
Dim pEnumGeomBind As IEnumGeometryBind
pEnumGeom = New EnumFeatureGeometry
pEnumGeomBind = pEnumGeom
pEnumGeomBind.BindGeometrySource(Nothing, pSelectionSet)
Dim pGeomFactory As Geometry.IGeometryFactory
pGeomFactory = New Geometry.GeometryEnvironmentClass
Dim pGeom As IGeometry
pGeom = pGeomFactory.CreateGeometryFromEnumerator(pEnumGeom)
pMxDoc.ActiveView.Extent = pGeom.Envelope
pMxDoc.FocusMap.MapScale = 2500
pMxDoc.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeography, Nothing, Nothing)
pMxDoc.ActiveView.Refresh()
... View more
10-07-2011
04:31 AM
|
0
|
0
|
967
|
|
POST
|
Yeah, it's quite neat to run ArcMap from somewhere else ... the pPageLayout is obtained in other parts of the code, where I check if the ArcMap App is running and if so I get the IMxDoc::PageLayout from this App. This seems to work since if I do something with this pPageLayout - e. g. change the Zoom Factor - in Access ArcMap responds ok. But still - I too have a hunch that this reference to the PageLayout could be the problem but I can't think of another method to verify or change this! Just check to make sure of something like... if the Set pPageLayout = ActiveView or something to that effect. I mean, what if the active view was not the LayoutView? Or does it interperet the activeView as something within Access? I really don't know.
... View more
09-29-2011
10:21 AM
|
0
|
0
|
1807
|
|
POST
|
James, that's quite easy actually. You only have to check the necessary ArcObject libraries in the Tools - References menu (ESRICarto UI Object library etc.) within the VBA environment in MSAccess and then you can use all ArcObject functions, methods and so on within Access - of course you'll need some ArcMap App that's running at the same time that your code interacts with. All that works - but for the export I mentioned. Daniel huh. I had no idea. I had to do a double take when I saw all of the ESRI references in the list! What's your code that sets the pPageLayout?
... View more
09-29-2011
10:05 AM
|
0
|
0
|
1807
|
|
POST
|
If you are attempting to place this code into VBA-Access, and I don't necessarily know the answer to this, but how does it know what an IActiveView or an IPageLayout2 is? Aren't these ArcObjects, specific to ArcGIS? Sorry I don't have a direct answer, but I am unsure how you could implement any ArcObject into a non-ArcGIS application (Microsoft Access).
... View more
09-29-2011
09:15 AM
|
0
|
0
|
1807
|
|
POST
|
I know the OP is about W7, but I think my initial problems stemmed from a flawed ICommand/IToolBarDef. Well, they DO work, I just wasn't able to register them with ESRIRegAsm and a Setup package. This is silly, but completely on me as to why I could manually "Add From File" the .tlb and the Toolbar would appear. Basically I was missing 2 seperate COM Registration functions, which I *thought* were the same thing, but apparently are not and both are required in the #Region of the IToolBarDef in order for ESRIRegAsm to register it and have it automatically appear after the setup is run. So, just here it is. I already had the "ArcGISCategoryRegistration/Unregistration sub's, but was missing the RegisterFunction/UnRegisterFunction sub's. These were added just below the COM GUID's #Region: #Region "COM Registration Function(s)"
<ComRegisterFunction(), ComVisibleAttribute(False)> _
Public Shared Sub RegisterFunction(ByVal registerType As Type)
' Required for ArcGIS Component Category Registrar support
ArcGISCategoryRegistration(registerType)
'Add any COM registration code after the ArcGISCategoryRegistration() call
End Sub
<ComUnregisterFunction(), ComVisibleAttribute(False)> _
Public Shared Sub UnregisterFunction(ByVal registerType As Type)
' Required for ArcGIS Component Category Registrar support
ArcGISCategoryUnregistration(registerType)
'Add any COM unregistration code after the ArcGISCategoryUnregistration() call
End Sub
#Region "ArcGIS Component Category Registrar generated code"
''' <summary>
''' Required method for ArcGIS Component Category registration -
''' Do not modify the contents of this method with the code editor.
''' </summary>
Private Shared Sub ArcGISCategoryRegistration(ByVal registerType As Type)
Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID)
MxCommandBars.Register(regKey)
End Sub
''' <summary>
''' Required method for ArcGIS Component Category unregistration -
''' Do not modify the contents of this method with the code editor.
''' </summary>
Private Shared Sub ArcGISCategoryUnregistration(ByVal registerType As Type)
Dim regKey As String = String.Format("HKEY_CLASSES_ROOT\CLSID\{{{0}}}", registerType.GUID)
MxCommandBars.Unregister(regKey)
End Sub
#End Region
#End Region
... View more
08-17-2011
11:43 AM
|
0
|
0
|
591
|
|
POST
|
Just a quick shot, but have you tried Nullable(Of Integer)? The problem is that in VB, Integers cannot be null (at least that's what I believe). Setting your Integer variable to "Nothing" would only produce the default value of 0(zero). But the Integer? Type should get you the result you want. Try something like this:
Dim myIntValue As Integer? = Nothing
row.set_Value(FIELD INDEX, myIntValue);
cur.UpdateRow(row);
G Hello, I'm looking for some help in setting a value to <Null>. I have a field in a table of type Long and it is a coded value domain. In ArcMap I am able to assign a value of <Null> to the field and save it without error. I'd like to be able to do this programmatically. How do I assign a <Null> to a Long data type in code?
row.set_Value(FIELD INDEX, WHAT GOES HERE?);
cur.UpdateRow(row);
G
... View more
08-17-2011
07:55 AM
|
0
|
0
|
1261
|
|
POST
|
Well.... I was finally able to manually register the components, and I still need to implement Neil's suggested solution by way of the Setup/Installer, but the following is how I was able to get this resolved: First of all, the .msi always ran without error, directories correctly created, .dll's all copied over, etc... The only issue with the Setup package is that it simply doesn't register the components. (still working on this, but very close). So... I HAVE HAD to get this thing going on the client's W7 workstation and even though no errors would popup after selecing to Customize-->Add From File (it always said "Objects Loaded"), but the toolbar would NOT show up in the list of Commands! So, here's what you do: Right-Click the shortcut to start ArcMap10 and choose "Run as Administrator". Then go thru the "Add From File" process and the Toolbar will show up in the list of Commands. Yep. Here's some credit to the problem solver (2nd from last post): http://forums.arcgis.com/threads/5602-Add-from-file-customize-tools-in-Win-7-fails?highlight=manually+register Neil -- can't thank you enough and I'll report back after I implement your suggestions on getting the actual setup.exe to do this registering stuff for me rather than having to hack thru these things manually. James
... View more
08-16-2011
03:40 PM
|
0
|
0
|
591
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-17-2020 10:47 AM | |
| 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 |
| Online Status |
Offline
|
| Date Last Visited |
01-22-2025
02:28 PM
|