Eagle Drag and Drop Configuration


 

The Drag & Drop facility enables the customization of actions to take place when an external file is "dropped" onto one of its windows.  Most file types are supported and for each window and each type of file (extension) a specific entry can be placed which specifies the command file to execute when a file of that type is dropped in that particular window. Each environment variable points to a macro to be executed when the file is dropped.

Configuration File Entries

 

D&D_<FileType>_<WindowType>

Variable Name Values

There are many variations of D&D variable but each operates in a similar fashion.  The name of the variable will be D&D_<filename>_<WindowType> where FileName represents type extension MOD |UFO |PLO |BMP |LWI |DWG |DXF |TIF |TGA |RAS |GIF |VAR |DAT |FNT |DLG |ASC |CMD and the WindowType represents a  window type of Root Window, Panel Window, Button Window, List Window RW|PW|BW|LW

Values 

An action

Description

Drag and drop FileType and action when dropped on WindowType.   Eagle Drag and Drop  manages many types of file differentiated by the extension. For each type of file (or extension) there is a registered entry in the Eagle configuration settings, which specifies the action that Eagle should take when a file of that type is dropped into an Eagle controlled window.  For instance, there is an entry called D&D_MOD_GW which is set to a macro command file name this will be executed when a model file is dropped into the graphic window (i.e. to load it into the stack).

Default

none

Example

There are many examples possible but the list below illustrate the macro action which will execute when a MOD, BMP, DAT, LWI and GWG file tyype are dropped on the GW (Graphic Window.

D&D_MOD_GW=c:\users\GrafixApp\startup\load.cmd

D&D_BMP_GW=c:\users\GrafixApp\startup\disp.cmd

D&D_DAT_GW=c:\users\GrafixApp\startup\text.cmd

D&D_LWI_GW=c:\users\GrafixApp\startup\showlwi.cmd

D&D_DWG_GW=c:\users\GrafixApp\startup\import.cmd

 

The Eagle configuration file essentially acts as a customizable registry of Eagle files to which different drag and drop attributes can be applied depending on the application. The path of the drag and drop files can include environment variables such as -eaglepath or -eaglesite but as a rule it is better to use the fully qualified path. The section Eagle Drag & Drop implementation lists the window/file type combinations handled in Eagle. For instance if an AutoCAD DWG file is dropped into the graphic window, Eagle can execute a command file specified corresponding to the setting in the D&D_DWG_GW= <filename> (meaning Drag and Drop of a DWG file on Graphics Window)

 

D&D_DWG_GW=@import/acad/import.cmd

D&D_MOD_GW=@file/open.cmd

D&D_CMD_GW=@file/exec.cmd

D&D_CMD_RW=@file/edit.cmd

 

The same file type can exhibit different action behaviour depending on where in Eagle the file is dropped. So a CMD file can be dropped on the GW (graphic window) and it will run the exec.cmd, or when dropped on the RW (root/frame window) the effect is to edit the file.

 

You can interact further with the dropped data by retrieving information from the other generated variables.  The name of the file passed to Eagle is stored in the variable D&D_FILENAME and the point where the file has been dropped can be retrieved through the D&D_2DPOINT and D&D_3DPOINT variables.  For instance a macro could retrieve this information as follows :

 

string filename, stemp

point pscreen, pworld

....

filename = env( D&D_FILENAME )

stemp = env( D&D_2DPOINT )

pscreen = ^stemp stemp = env( D&D_3DPOINT )

pworld = ^stemp

...

 

 

 

D&D_FILENAME

Values 

a path and file name

Description

Contains the dropped file name generated automatically by Eagle

Default

none(the file is generated by Eagle)

Example

D&D_FILENAME=//C/Documents and Settings/David/Desktop/designjet.mod

 

 

D&D_3DPOINT

Values 

a 3D coordinate

Description

Contains the 3D co-ordinates where the file has been dropped on the graphic window

Default

none (the coordinates are generated by Eagle)

Example

D&D_3DPOINT=(250.000000,230.000000,0.000000) 

 

 

D&D_2DPOINT

Values 

a 2D coordinate

Description

Contains the 2D co-ordinates where the file has been dropped on the graphic window

Default

none (the coordinates are generated by Eagle)

Example

D&D_2DPOINT=(437,333)