|
POST
|
It depends on what you're using to create your installer. Using the standard Visual Studio deployment project you just open the File System view and add the file to the correct folder. You can create a registry entry on the Registry view and set its value using [TARGETDIR] plus the rest of the path to the database (i.e. [TARGETDIR]\Data\ourDatabase.mdb).
... View more
04-27-2011
12:20 PM
|
0
|
0
|
805
|
|
POST
|
We do this all the time. The installer copies the geodatabase and the application assembly to a specific location relative to the installation directory that the user chooses during the installation wizard. For instance, the application assembly is copied to ...\GISi\OurApplication and the geodatabase is copied to ...\GISi\OurApplication\Data. Our code uses System.Reflection.Assembly.GetExecutingAssembly.Location to get the location of the assembly then uses this path to build the path to the geodatabase. In this case it would look like this: dbasePath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location) & "\Data\ourDatabase.mdb" The relative path of the database to the assembly is always the same. The only thing that changes is the root directory where the user chooses to install the application. You can also just have the installer create a registry entry that contains the path to the database and have your code read the path from that registry key.
... View more
04-27-2011
11:59 AM
|
0
|
0
|
805
|
|
POST
|
You can only add high level geometries to feature classes. A path isn't a high level geometry. A line feature class can only store polyline geometries. You need to be creating a new polyline geometry and using that to set the geometry of a new feature. Dim polyline As IPolyline = new Polyline polyline.FromPoint = onePoint polyline.ToPoint = otherPoint Dim feature As IFeature = featureClass.CreateFeature feature.Shape = polyline feature.Store
... View more
04-15-2011
05:29 AM
|
0
|
0
|
776
|
|
POST
|
Here's an mxd (version 9.3.1) that contains two user forms and module with a public method for loading a combobox. Both of the forms call this method in their Initialize event. Hopefully this will help!
... View more
04-01-2011
10:28 AM
|
0
|
0
|
2505
|
|
POST
|
What does your PopulateComboboxes method look like now? You should have changed the method definition to take a combobox as a parameter and also updated the code to reference this parameter. Something like this: Public Function PopulateComboxes(combobox as Combobox) combobox.AddItem("hello") combobox.AddItem("world") End Function
... View more
04-01-2011
09:40 AM
|
0
|
0
|
2505
|
|
POST
|
Been awhile since I've done anything in VBA/VB6 but if I remember right the Shell function doesn't allow you to pass parameters to the executable. You need to be able to pass the path to the document you want to open. Use the Windows API function ShellExecute instead.
... View more
04-01-2011
09:27 AM
|
0
|
0
|
720
|
|
POST
|
There's no need to use CreateObject. The Microsoft Common Dialog control is an actual Form control that you can add to the toolbox and drop onto your dialog in the designer. You then access it in code just like you would any other control on the dialog. The control is included in a system file (comdlg32.ocx) that should be on any machine running Windows.
... View more
04-01-2011
09:22 AM
|
0
|
0
|
1495
|
|
POST
|
Since the method is loading a combobox, pass in the combobox, not the form. If you pass in the form then the method will not know which control on the form it should be loading. Public Function LoadCombobox(comboBox As ComboBox) As Boolean
' do whatever.
End Function
' call the method from the form.
LoadComboBox(Me.theCombobox)
... View more
04-01-2011
09:15 AM
|
0
|
0
|
2505
|
|
POST
|
The CommandBars object can be used to access any toolbar, menu, command, or tool regardless of whether or not it is currently visible in the application. The following VBA code will toggle the visibility of the 3D Analyst toolbar. All you need to do is replace the ThisDocument object with a reference to the current document and replace the GUID with the correct value for the toolbar you want. Sub toggle3dAnalystToolbar()
Dim uid As New uid
uid.Value = "{3FA6313B-7EB4-11D4-A10D-00508BD60CB9}"
Dim commandBar As ICommandBar
Set commandBar = ThisDocument.CommandBars.Find(uid)
commandBar.Dock (esriDockToggle)
End Sub
... View more
03-29-2011
05:40 AM
|
0
|
0
|
760
|
|
POST
|
lineFeature.Shape = (IGeometry)path; You're attempting to add a Path geometry to a Polyline shapefile. A Path and a Polyline are not the same thing. Add the Polyline you're creating instead of the Path.
... View more
03-23-2011
09:52 AM
|
0
|
0
|
1920
|
|
POST
|
You're mixing usage of the managed .NET class and the COM class. You may want to read the section on Interoperating with COM in the developer help for an explanation. Dim color As ESRI.ArcGIS.Display.RgbColor = New ESRI.ArcGIS.Display.RgbColorClass Use this (interface type w/ COM class) Dim color As ESRI.ArcGIS.Display.IRgbColor = New ESRI.ArcGIS.Display.RgbColor or this (managed .NET class) Dim color As ESRI.ArcGIS.Display.RgbColorClass = New ESRI.ArcGIS.Display.RgbColorClass
... View more
03-23-2011
09:43 AM
|
0
|
0
|
2801
|
|
POST
|
You mention checking out a license. If you're running your code inside ArcMap you don't need to do this. In fact, you shouldn't be doing that. You only need to check out a license if you're building a standalone application (*.exe). The CLSID should not be necessary but I always specify one. It used to be required and it's an old habit (probably a good one). You also said it worked the first time then not the second time. The CreateFeatureClass method will not overwrite an existing feature class. If the feature class already exists, it will throw an exception. You should have code somewhere that makes sure the feature class does not already exist. I don't see it in what you posted so if you have it somewhere else then you should be good to go. If not, you'll want to add that. Also, I don't see where you're creating the ObjectId field for your fields collection. It may be the case that it will create one automatically but I always create it myself. ESRI has changed how this method works several times over the years so I'm not sure what is done now by default. These are just a few things off the top of my head.
... View more
03-10-2011
04:53 AM
|
0
|
0
|
1646
|
|
POST
|
I haven't had much time to look at this but when I try to add a new record to the table using the ArcMap Editor I get an error saying there must be a record in a related table. I tried using an ObjectId from the related feature class and still got the same error. Are you able to add records to this table in ArcMap? If so, do you still get the error using those same attribute values in your code?
... View more
03-09-2011
12:29 PM
|
0
|
0
|
1280
|
|
POST
|
Visual Studio 2010 is not supported at ArcGIS 9.3. At ArcGIS 10, Visual Studio 2010 is supported but not all of the add-in functionality is available in the Express editions.
... View more
03-08-2011
09:07 AM
|
0
|
0
|
1146
|
|
POST
|
You mentioned this is a console application. Are you checking out a license before running any of this code? Are you running this code inside of an edit session? If so, you shouldn't be creating new feature classes while in an edit session. Also, once the feature class has been created and your code errors out, can you shut down your application then go back and create a feature through code?
... View more
03-08-2011
09:00 AM
|
0
|
0
|
2301
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-20-2014 05:29 AM | |
| 1 | 02-01-2011 04:18 AM | |
| 1 | 02-04-2011 04:15 AM | |
| 1 | 01-17-2014 03:57 AM | |
| 1 | 10-07-2010 07:37 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|