Such methods are fine in an interactive mode when we need to manually create buffers. However, if you are writing macros to help automate the process, you need a command-line alternative that avoids launching a dialog box. To do this for our Create Buffer example, simply precede the command name, MAPFDOBUFFERCREATE, with a hyphen when you enter the command on the command-line. Here’s how to create a 20ft buffer via the command-line:
- At the command line enter –MAPFDOBUFFERCREATE (note the minus sign) and press Enter. The following prompt appears:
Buffer create options [Input/Distance/Merging/Output/Go]: - Enter ‘D’ then 20 to enter the buffer distance.
Buffer create options [Input/Distance/Merging/Output/Go]: D
Enter a buffer distance in Feet <>: 20 - Enter ‘M’ and then ‘S’ to ensure that multiple buffers are merged into a single feature.
Merge buffers [None/Single/Overlapping]: S
A single output buffer will be created - Enter ‘I’ then select the features to be buffered.
Buffer create options [Input/Distance/Merging/Output/Go]: I
Select objects: 1 found
Select objects: - Enter ‘G’ to create the buffer as specified.
Buffer create options [Input/Distance/Merging/Output/Go]: G
Layer Properties Manager
Command: -Layers
Prompt: [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck
/Unlock/stAte/Description/rEconcile]:
Block Definition
Command: -Block
Prompt: Enter block name or [?]:
Drawing Cleanup
Command: -MapClean
Prompt: Enter profile name to load:
Attach Object Class Definition File
Command: -AttachDef
Prompt: Enter name of object definition file:
In addition, certain system variables can also be used to affect the display of dialog boxes. For example, the EXPERT variable controls the display of warning dialog boxes. When the value of EXPERT is set to ‘0’, warnings and prompts are issued normally; when EXPERT is set to a value between ‘1’ and ‘5,’ specific warnings and prompts are suppressed.
Another useful system variable is FILEDIA. This variable controls the display of dialog boxes used with commands that read and write files. When the value of FILEDIA is set to ‘0’, command-line prompts are used to prompt for file names; when FILEDIA is set to ‘1’, dialog boxes are used.
1 comment:
Along with the variable "filedia" don't forget about the "cmddia" variable, some of the original map commands from the adeXXX functions will still call a dialog box if that's set to 1.
Post a Comment