ArcGIS

From Wildsong
Revision as of 23:10, 22 September 2005 by Brian Wilson (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

From the ArcGIS mailing list

Method to insert data entry forms

Eric O’ Neal

Make a new project, or open the macro editor of your old one, and add the form. After that, go back to the map and right click somewhere in one of the grey toolbars. Scroll down to 'Customize'. Click the 'Commands' tab at the top and change the "save in:" to 'your project' (not ' Normal.mxt'. In the left box, scroll down to 'UIcontrols'. Click 'New Control'.->>'Button Control' Drag the new button to a toolbar. Right click the new button and select 'View Source'. You will see the click event. type in:

'frm1.show'

The button should work now. You can make new Toolbars in the 'Customize' part and drag this button on to them if you want.

Lawrence Hartpence

The way that I have brought data entry forms into ArcGIS is by adding UIControls. In ArcMap, go to the "Tools" menu and then select "Customize". Select the "Commands" tab and scroll down to the "UIControls". After you select "UIControls", three buttons will appear below the pick list, click on the one that says "New UIControl..." A window will pop up with an array of different controls you may create. Choose new UIButton Control. Once this control is created, you will see it in a pick list on the Right side of the "Customize" window. Click on the new UIButton control and drag it to one of the toolbars. Once on the toolbar, right click on the button and in the menu which Pops up, choose "View Source". This takes you to VBA. You access the form by typing the form's name Then ".show (0)" in the Sub which is automatically set up for your UIButton control. It will look something like this: Private Sub UIButtonControl1_Click() QueryForm.Show (0) End Sub

Nick Seigal

(1) VBA is embedded in ArcGIS. You can access the Visual Basic Editor from the Tools menu. VBA has its own forms engine that is different from that in VB (more on that later). Much like in Excell or Access, you can create code and even forms that run like macros. These can be added by hand to the interface of a map document or even to the Normal template (so that they are available in all new Map Documents).

(2) VB6 is often used (although you could also use VB.Net, C++ or C#) to create what is called an "extension" to ArcMap. An example of this approach are ESRI's own extensions, such as Spatial Analyst. To add functionality to ArcMap in this way requires fairly advanced VB skills, although there are many small and fairly easily tweaked samples that you might get to work without having to mess with the extension sturcture. All you would need to do is have the Visual Basic 6 development environment on your machine and take an ESRI sample, add the VB form and data editing functionality you want to that extension framwork and compile the extension as a .dll file. Then, when this file is registered with Windows and with the ESRI COM Categories (ESRI Add Ins to VB6 help with these tasks), the fuctionality will Appear like magic in ArcMap.

(3) Model Builder can be used to create tools for ArcToolbox that use form-like interfaces and which do basic editing tasks. Check out the documentation on that tool for more details.