Quantcast
Channel: Forums - ArcGIS for Desktop - Installation, Configuration
Viewing all 511 articles
Browse latest View live

VBA/Macro's help (newby alert!)

$
0
0
Hi guys,

First post here... I work in GIS, using ArcGIS 9.2, and I am a complete newby to VBA macro's scripts etc.
I hope this is the right place to post this (did a search for VBA and this thread seem to come up).

Basically I only started using VBA because a user wanted to add a count of unique values to one of his shapefiles, and then the count to appear in his legend.

The count field displays the count when in layer properies>unique values, but as soon as you come out of that the count ends.

So I found a macro which takes existing Unique Value and calculates feature counts for each value, adding the count to each Class Label. Class Labels appear in the ArcMap Table of Contents and Legend.

After a bit of trial and error I got the script to work. The problem is the script doesn't work on every shapefile, it works on some but not others.

Here is the script;

Const DESCRIP_FIELD = "STATE_NAME"
Const CONCATENATE_TO_BUILD_DESCRIPTION = True
Const CONCAT_CHAR = vbNewLine

Option Explicit

Sub UniqueValues_LabelCount_and_DescripFromField()

Dim pDoc As IMxDocument
Set pDoc = ThisDocument
Dim pMap As IMap
Set pMap = pDoc.FocusMap
Dim pGeoLayer As IGeoFeatureLayer
Set pGeoLayer = pMap.Layer(0)

If Not TypeOf pGeoLayer.Renderer Is IUniqueValueRenderer Then
MsgBox "Current symbology is not Unique values. Exiting."
Exit Sub
End If

Dim pUVRend As IUniqueValueRenderer
Set pUVRend = pGeoLayer.Renderer

If pUVRend.FieldCount > 1 Then
MsgBox "Current Unique values symbology is based on multiple fields. Exiting."
Exit Sub
End If

Dim sFieldName As String
sFieldName = pUVRend.Field(0)

Dim i As Integer
Dim varValue As Variant

Dim pFeatClass As IFeatureClass
Set pFeatClass = pGeoLayer.FeatureClass

Dim varLabelDescrip As Variant
For i = 0 To pUVRend.ValueCount - 1
varValue = pUVRend.Value(i)
varLabelDescrip = GetLabelDescription(pFeatClass, pUVRend.Field(0), varValue)
pUVRend.Label(varValue) = varLabelDescrip(0)
pUVRend.Description(varValue) = varLabelDescrip(1)
Next i

pDoc.ActiveView.ContentsChanged
pDoc.UpdateContents
pDoc.ActiveView.Refresh
End Sub

Private Function GetLabelDescription(pFeatClass As IFeatureClass, ValField As String, Value As Variant) As Variant
' returns an array of length 2
' (0) is the new label (string) appended with count of features
' (1) is the new descrip (string) driven from DESCRIP_FIELD

Dim pQueryFilter As IQueryFilter
Set pQueryFilter = New QueryFilter

pQueryFilter.WhereClause = ValField & " = '" & CStr(Value) & "'"
pQueryFilter.AddField DESCRIP_FIELD
Dim pFeatCursor As IFeatureCursor
Set pFeatCursor = pFeatClass.Search(pQueryFilter, False)

' ---------------------------------------------------------
' Description
Dim pFeat As IFeature
Dim sDescrip As String
Dim iDescrip As Integer
iDescrip = pFeatClass.Fields.FindField(DESCRIP_FIELD)
Set pFeat = pFeatCursor.NextFeature

Dim iCount As Integer
iCount = 0
Dim bCountsDetermined As Boolean
bCountsDetermined = False

If CONCATENATE_TO_BUILD_DESCRIPTION Then
bCountsDetermined = True
Do While Not pFeat Is Nothing
iCount = iCount + 1
If sDescrip <> "" Then sDescrip = sDescrip + CONCAT_CHAR
sDescrip = sDescrip + CStr(pFeat.Value(iDescrip)) ' get value from DESCRIP_FIELD
Set pFeat = pFeatCursor.NextFeature
Loop

Else ' only get descrip from first feature found
If Not pFeat Is Nothing Then
sDescrip = CStr(pFeat.Value(iDescrip)) ' get value from DESCRIP_FIELD
End If

End If

' ---------------------------------------------------------
' Label
If Not bCountsDetermined Then
' optimization: re-query only if we don't
' already have the counts from above
iCount = pFeatClass.FeatureCount(pQueryFilter)
End If
Dim sLabel As String
sLabel = Value & " (" & iCount & ") "

' ---------------------------------------------------------
' setup return array and return
Dim sReturnArray(2) As String
sReturnArray(0) = sLabel
sReturnArray(1) = sDescrip

GetLabelDescription = sReturnArray

End Function

I modify the constants for my particular data and situation (so essentially change 'STATE_NAME' to whatever the field im using is), it worked for the particular shapefile our user was using, but out of interest I tried it with a few other shapefiles, and it works for some and not others, the error message sometimes varies, but the latest one read ' Run-time error '-2147220985 (80040207) Automation error. The owner SID on a per-user subscription doesn't exist'.

Like I said above, I am a complete newby to this, and only started using it last week... it could be something obvious, so apologies if so.

Any help appreciated :)

Dan

ArcGIS not recognizing a license that is authorized

$
0
0
I have installed ArcGIS 10.1 (single use) and several licenses. The one in question is Spatial Analyst. When I open the ArcGIS administrator it says that it does have the license and that it is authorized. However, when I am in ArcMap and try to use the Spatial Analyst tools it says that there is no license. Does any one know how to fix this?

Thanks

problem uninstalling ArcGIS desktop 9.3 and installing 10.1

$
0
0
I want to install ArcGIS Desktop 10.1. But I am told I need to uninstalll my ArcGIS 9.3.
When I try to unistall ArcGIS 9.3 , it goes fine for a while but then it gives me error message " Unable to run C:\...ArcGIS\Bin\CatInstall.exe Eror Status 0" Attachment 21039
I have tried every posible way: I tried through windows remove program from control panel, using the ArcGIS Uninstaller, even from the registry by using format similiar to this:
msiexec /X {1F34839E-4826-4B64-B1B3-42E5AE8DEC5A} /L*V C:\Desktop_uninstall.log

But none of these worked! Could you please help me? Both the 10.1 and 9.3 are evaluation versions!
Attached Thumbnails
Click image for larger version

Name:	Unbenannt1.jpg‎
Views:	N/A
Size:	41.1 KB
ID:	21039  

suggestion for moving our licence manager

$
0
0
Hello,

Our IT dept is retiring our old licence server and would like to know if there is an easy way to re-point our clients to the new server. We are not too worried about the installation of the licence manager software, but rather an easy way to update the clients. The licenece manager's machine name will be changing.

Is there a file that they can manipulate during user's login or is it a regestry setting?...

(or do we have to visit every client personally)

(all 10.0)

any suggestions would be helpful,
thanks
Dave

ArcGIS 9.2 in XP mode

$
0
0
Hello...

I wonder if anyone could help with a little problem?

I'm moving from an old desktop PC to a new HP Elitebook 8470p with Windows 7 Professional 64 and want to take ArcGIS 9.2. I have installed XP mode from MS and slotted my venerable ArcGIS install disk in the tray. All goes well until I get the following message:

The Windows installer does not permit installation from a remote desktop connection

Can anyone offer advice on how to proceed please?

Cheers

Phil

arc info authorization not working?

$
0
0
Hello,

I an having an issue with the authorization process for arc desktop 10 trial 180days. I have submitted the code and get a message that authorization was successful. When I try to use arc info I get a message saying it is not authorized. I even went and bought another book and used a different authorization code and get the same error. The extensions appear to be authorized yet not the arcinfo extension. Please help.

Cannot Open File Under UnitedStates.gdb

$
0
0
Hi there. I've downloaded everything and can open arcmaps. However, when I go to do assignment 1-1 Chapter 1 page 43 I cannot open the file USStates which is the last part of the file. I get as far as UnitedStates.gdb and nothing is in there. Any ideas?! I've tried to reinstall and still have no had any luck. Thanks!

I get as far as ESRI\GIST1\Data\UnitedStates.gdb\

Authorizing ArcInfo Error

$
0
0
I'm trying to authorize a concurrent license for ArcInfo onto our license server administrator. It gives me the following error: Authorization denied because request would have exceeded max copies for the following authorization number:(EFLXXXX)

I have successfully authorized other concurrent licenses on the license manager and have checked to make sure this number isn't a duplicate. Can anyone tell me what I need to do to get this license authorized?

Thanks!!

Change Location of SearchIndex in ArcGIS Desktop

$
0
0
Hi there,

Does anyone know how to change the location of the search index folder from C:\Users\<Username>\AppData\Local\ESRI\Desktop10.1\ArcCatalog\SearchIndex ?

We want to store it in a network location ?

I`m hoping its a registry key or some config file.

Thanks for your help.

dd_dalal

License Manager issues with 10.0

$
0
0
All,

I have the License Manager installed on our SBS 2011 server.
For testing purposes, I have switched of the Microsoft Firewall to make sure this is not the cause of the problem.

License Manager is running as it shows as RUNNING in the License Manager Administrator.
But when I select the Diagnostics option and do a diagnose. It comes back as NOT RUNNING.

Also when I try to connect from a Client Machine to the License Manager, I get "SERVERNAME" is an invalid hostname. Please enter a valid hostname.

As stated, no Firewalls are enabled.
Does anybody have an idea?

Raoul.

Windows 2008 Firewall forgets exception for 10.1 License Manager

$
0
0
When I initially installed the 10.1 license manager on my Windows Server 2008 (64-bit, R2, Enterprise, on a VM) it worked like a charm - the install created an exception for TCP ports 27000-27009, and the License Manager handed out licenses to users like a dream.

I came to a point were it was necessary to manally stop the License Manager service from the Services control panel. After I started it back up, desktop users weren't able to contact the license manger and run AcGIS.

It's defintely the firewall because:

- I was able to run ArcCatalog on the license manager server (i.e. it contacted the license manager running on the local compuer)
- Turning Windows Firewall off solved the access problem for local computers.

For now Ive got Windows Firewall turned off on te server. But I'd eally like to fiure out what actually happened and how to fix it.

Why should Windows suddenly forget this exception (and not others like the built-in RDP exception)?

Event Viewer shows dropped packet events for these failures, but the bizzare part is that it's an Inbound connection from the license server's IP address to the desktop's IP address!

ArcGIS exe is not a valid Win32 application - Install error

$
0
0
When trying to install ArcGIS 10, I receive the 'not a valid Win 32 application' error. I am running Windows 7 on a 64bit system. Is there a different install file for the 64bit? I'm confused. Thanks for the help!

2 folders in the wrong place

$
0
0
When I installed the student version of Arcmap 10, I specified the F: disk for where I wanted it placed, It did install most of the product there, but when I look at the configuration information screen, I see 2 folders that were placed on the C: drive: Application Data Folder and System Temporary Folder. My C: drive is a small SSD and I do not want this stuff there. How do I move it?

Ed

ArcGIS Desktop - Extensions - Licence not released

$
0
0
Hi

We have multiple users accessing a Concurrent Licence.
We have a single 3D Analyst Extension.

User A can get hold of the 3D Analyst licence.
If they untick the licence - the 3D Analyst licence is not released for User B..
Only by closing Arc down entriely - is the licenced freed up for User B.

We've checked all the obvious things (e.g. User A doesn't still have something like ArcScene open etc ).
The same behaviour happens for all users - so its not just one computer / user / on the system.

It is as if the Licence Server doesn't know the licence is released and available for another user.

I don't have access to the licence server ( but can speak to the person who does).
Is there a setting we can tweak so it checks every x minutes a licence has been released?
or something else we can tweak - so as soon as a user unticks an extension - it becomes available for others?

Any suggestions most welcome

Mark

Issue with Alias for License Manager 10.0

$
0
0
We just moved our License Manager for 10.0 to a new Server (Windows Server 2008 R2 Standard, SP1, 64-bit). There are only ~4 personnel hitting the license manager and testing it right now, as we are using an Alias rather than the actual server name.

All appeared to be working great for the last two - three weeks until one of the users tried to do an Import (Feature to Feature) in an SDE database. When he used the Alias on his local machine, the dialog box for the tool would freeze and not show the input/output options. When he switched back over to the server name, the tool would work.

I reviewed this problem and I tested the scenario on two other machines, using both the Alias and the Server Name.

Server 1: Alias, Service Pack 5, Successful
Server 1: ServerName, Service Pack 5, Successful
Local Machine 1: Alias, Service Pack 5, UnsuccessfulLocal Machine 1: ServerName, Service Pack 5, Succcessful
Local Machine 2: Alias, Service Pack 5, Successful
Local Machine 2: ServerName, Service Pack 5, Successful
(I will note also, that it works with SP4, as I ended up upgrading my machine to 5 in the process).

When the user tried to switch back to the Alias today, he was able to access all the tools and perform the process mentioned above without any issue.

Has anyone experienced any issues, discrepancies, bugs, etc. using an Alias for the License Manager?

Any input would be appreciated.

An error occured while trying to open LSAdmin.exe

$
0
0
Hi,

I was trying to do the upgrade from ArcGIS 10 to 10.1. I have concurrent licenses. I uninstall License Manager 10 and install LM 10.1, when double click it to open it and do the upgrade I received a message "An error occured while trying to open LSAdmin.exe, so I Install again LM 10 and it worked.

Any clue what could be happening?

The best regards,

Diego Llamas

10.1.1 Set Display Cache Error

$
0
0
For some reason, it will not let me change the display cache to a NAS device we have newly installed. Permissions look all good, and I can point to a previous cache without a problem. Cannot use Browse or UNC paths. Error:

Can not [sic] apply cache changes. Cache might be used by other process [sic], access to cache folder is restricted or entered settings are not valid.

Also tried setting up a different folder and pointing to that. No luck.

Corrupt Tutorial Data

$
0
0
Does anyone have a known-good copy of the tutorial data install I can download? I downloaded the Desktop 10 trial and I've tried downloading the tutorial install three times. For some unknown reason it took over 8 hours last night even with my broadband connection.

Every time I try installing it blows up saying that setup3.cab is corrupt and I can't ignore it and continue. I'm completely new to ArcGIS and it'd be a great help if I could do the tutorials.

Help Moving Old Dongle Key to Windows 7 Computer

$
0
0
Could anyone give me some advice on moving an old parellel dongle hardware key from a Windows 2000 box to a Windows 7 box? Can it be done as I have not had any success yet. Am using ArcGIS 9.3.1 now but will be upgrading to 10 soon. Thanks

My ArcGIS 10.1 search window is not working

$
0
0
I am having issue with my AcrGIS 10.1 Search Window.
I am getting the following error message:
"Object reference not set an instance of an object."
the second message when I try to open the search space.
"Unhandled exception has occurred in a component in your application. If you click continue, the application will ignore this error and attempt to continue".
but when i click Continue not thing happens. Please help!
Viewing all 511 articles
Browse latest View live