## Install

1. Make sure your computer has installed `Allegro` and has `extracta` components (generally available). Lower versions of Allegro may not work properly, please try it yourself.

2. Right-click `install-allegro-extension.bat` and then use the Administrater permission to install.

    Check if there is any error message in the bat run window.
  If there are errors, install the plugin manually.

3. Relaunch `Allegro`, you should see `Batch Conversion` on menubar, otherwise installation was failed.

### Install manually

1. Make sure the `ALLEGRO_PCBENV` system environment variable exists. Normally, the allegro installer will create the environment variable. Otherwise manually create it with value similar to `C:\Users\YourName\pcbenv`.

    Review the `ALLEGRO_PCBENV` system environment value via one of following ways:
    - In Allegro skill command mode, type `getShellEnvVar("ALLEGRO_PCBENV")`
    - In windows command prompt, type `echo %ALLEGRO_PCBENV%`

3. Copy these 4 files to the directory specified by the `ALLEGRO_PCBENV` system environment variable.
    -  `convertPcbToAscii.ile`
    -  `convert.form`
    -  `convert_about.form`
    -  `brdCmdFile.txt`
    -  `draCmdFile.txt` 

4. Check whether the `allegro.ilinit` file already exists under `pcbenv`, add the code `loadi ("convertPcbToAscii.ile" "ascii")` in a new line into `allegro.ilinit`.
    - If NOT exists, copy `allegro.ilinit` into the directory.
    - If already exists, open it and add a new line code of `loadi("convertPcbToAscii.ile" "ascii")`

## How to use

1. Launch `Allegro`, click `Batch Conversion` on the menu bar.

2. Take converting PCB files as an example; click the menu item `Convert PCB To ASCII...`, will open a pop-up window.

3. Fill the **Source Directory** and **Output Directory** in the pop-up window, click `Translate` button to start the conversion.

    **Source Directory** is the folder path where the Allegro PCB file (*.brd) is located

4. Wait a moment, there will be a pop-up window reminding you that the conversion is complete. You can see the converted ASCII *.ebrd file in the output folder.

    Once the conversion starts, it cannot be interrupted until completed. If there are many files to be converted, it will take more time.

## Known Issue

##FAQ

| Problems | Detailed Problems | Possible Causes | Quick Troubleshooting |
| --- | --- | --- | --- |
| menu is not displayed | 'Batch Conversion' menu is not displayed | environment variables are not correct, resulting in the script not loading | In the skill pop-up window, type `getShellEnvVar("ALLEGRO_PCBENV")` and `getSkillPath()` to view the value of ALLEGRO_PCBENV environment variable, type `_openConvertDialog("PCB")` to confirm whether the script was loaded correctly by command messages |
| Menu not displayed | 'Batch Conversion' menu or submenu not displayed | Script conflict | Uninstall other scripts; enter '_openConvertDialog ("PCB") ' to test whether the pop-up window can be opened |
| The pop-up window does not display | The pop-up window does not display after clicking the submenu | Script execution error | Contact development |
| Conversion failed | After the conversion, the log shows that all file conversions failed | Script problems | Contact the developer |


## Update

### 20240625
1. Batch generation of device files

### 20240606
1. Fix the problem of library file conversion failure

### 20240520
1. Get global dynamic copper laying parameters
2. Get the equal-length network group

### 20240507
1. Improve call extracta compatibility
2. Fix the sensitive issue of Allegro file suffix recognition case
3. Perfect extraction information. Grouping, forbidden area attributes, differential pairs, FORMAT and MECHANICAL type symbols

### 20241127
1. Improve the extraction information. Add component attribute related information extraction: COMP_CLASS COMP_VALUE FUNC_DES FUNC_TYPE

### 20241211
1. New feature: 3 in one conversion
2. Remove requirement of `HOME` environment variable, avoid unexpected side effects.
3. Add a windows batch file `install-allegro-extension.bat` to auto install this plugin.

### 20241212
1. Improve auto installation bat file

### 20241216
1. Improve the extraction information. Add net attribute related information extraction: NETCLASS_GRP_NAME PHYSICAL_CONSTRAINT_SET SPACING_CONSTRAINT_SET
2. Extract NETCLASS/MATCH_GROUP/DIFF_PAIR/NETCLASS-NETCLASS/Electrical（Net Length）rules.

### 20241218
1. Fix the 3-in-1 function override other single items function.
