Tuesday, February 12, 2013

Breaking The wd.env File Down Line By Line

The wd.env file is simply a text file that contains settings and paths that direct AutoCAD Electrical to certain files and actions. These files can include the catalog and footprint lookup databases, slide libraries, and user circuits. This file is pivotal to setting up a proper networked/multi-user environment.

Where does the wd.env file live? See this blog post..  Where Does The wd.env Path Get Set?

Listed below in red is the default wd.env file. My comments will be in black under the line they are describing. Throughout this break-down I will show examples of changes, showing both the wd.env file and the results.

First of all, every line that starts with an asterisk (*) is ignored by Electrical. These lines are for our comments and notes while working on the file. Instead of blowing away an entire line and replacing it with my own text, I will add an asterisk to the default line and then copy and paste it below the line being modified. That way I can always reference or return to the default if needed. And as always, make a copy of this file before you start playing with it.

* AutoCAD Electrical - project environment settings.
* Format is: env code,setting,description (separated by commas)
     This row shows the format used in all other lines below.
* The setting value, if a path, can be fully hard-coded or can include one
* of the following aliases:
*
* %PF_DIR% = base executable install folder
*            (example: "c:\Program Files\Autodesk\Acade 2010\")
*            (corresponds with global GBL_WD_BASEINSTALL)

* %DS_DIR% = base "Documents and Settings" folder
*            (example: "c:\Documents and Settings\{username}\Application Data\Autodesk\AutoCAD Electrical 2010\R18.0\enu\Support\")
*            (corresponds with global GBL_WD_DOCSETBASE)

* %WD_DIR% = base folder where "wd.env" is located
*            (example: "c:\My Documents\AcadE 2010\AeData\")
*            (corresponds with global GBL_WD_DOCSETWDBASE)

* %SL_DIR% = base folder for "Libs" symbol library subfolder
*            (example "c:\Documents and Settings\All Users\Documents\Autodesk\Acade 2010\Libs\")
*            (corresponds with global GBL_WD_BASELIBS)

* %ACAD_SUP_FIRST% = first path listed under ACAD support file path list
* %ACAD_SUP_LAST% = last path listed under ACAD support file path list
     %PF_DIR%, %DS_DIR%, %WD_DIR%, %SL_DIR%, %ACAD_SUP_FIRST%, %ACAD_SUP_LAST% These are only aliases to predefined paths. The global variables must be modified to modify these paths. See below...
*
******************
*
*  "*" in first column disables the line (i.e. comments it out)
*
************************************************************************************
* NOTE: internal global variables can be preset using a "SETQ:" prefix.
* Format is: "SETQ:", global variable name, value, description
     This is the format needed for setting global variables. Want to move all the standard symbols to the network? Add a row with your network path as shown in the next row.
SETQ:GBL_WD_BASELIBS,L:\Electrical Symbols\, Network symbol library location
Remember to press Default button in the Project Properties dialog for each row affected.
      image         image

* By default, "value" is evaluated as a character string. To force it to read as an
*   integer, real, or nil value, preceed value with ' character.
*   ex: SETQ:GBL_wd_pi,'3.1416, evaluates as "real" number
*   ex: SETQ:GBL_wd_int,'7, evaluates as "integer" number
*   ex: SETQ:GBL_wd_xx,'nil, sets global to "nil" or null value
*   ex: SETQ:GBL_wd_str,romans.shx, defaults to character string value
     There are many global variables. The text above is simply showing how to insert null values, or place a series of numbers. This is necessary because the value between the two commas is considered a text field. If the value being entered between the commas is a number be sure to pay attention to these rules.
*
************************************************************************************
* Program executable, dialog, and support files
************************************************************************************
WD,%PF_DIR%/support/,AutoCAD Electrical dialog files, xls templates, and other support files
    
This is the support folder. An alternate support path can be set below. To change the support path here you need to first update the GBL_WD_BASEINSTALL variable. This is set as the base install location and typically I leave it alone.

************************************************************************************
* User temp file folder, CANNOT shared with other users
************************************************************************************
WD_USER,%DS_DIR%/user/,AutoCAD Electrical user temp file folder
     All users must have their own temp folder. This is another path that I leave as is. There are cases where users only have write permissions to a certain folder on their local drive and then this path is used. 

************************************************************************************
* Symbol Insertion and Library Paths
************************************************************************************
WD_LIB,%SL_DIR%/jic125;%SL_DIR%/jic125/1-;%SL_DIR%/pneu_iso125;%SL_DIR%/pid;%SL_DIR%/hyd_iso125, schem, 1-line, and pneumatic/pid/hydraulic default paths
     The folders are searched in order from left to right. Placing your custom symbol folder first in the path will have Electrical search it before the default paths. Don't mix custom symbols with the default libraries. When uninstalling AutoCAD Electrical, the default library folders are uninstalled. I have had to listen to several users complain after their ALL their custom symbols were removed with an uninstall. This path should look something like this:
WD_LIB,L:Custom Electrical Symbols/Schematic;L:Custom Electrical Symbols\Schematic\1-;L:\Symbols\Custom Hydraulic;L:\Symbols\Custom PID;L:\Symbols\Custom Pheumatic;%SL_DIR%/jic125;%SL_DIR%/jic125/1-;%SL_DIR%/pneu_iso125;%SL_DIR%/pid;%SL_DIR%/hyd_iso125, schem, 1-line, and pneumatic/pid/hydraulic default paths
I like a folder structure with these starting folders:
...\Custom Electrical Symbols\Schematic            Custom Schematic symbols will go here
...\Custom Electrical Symbols\Schematic\1-        1-Line symbols would will go here
...\Custom Electrical Symbols\Hydraulic              Custom Hydraulic symbols will go here
...\Custom Electrical Symbols\PID                      Custom P&ID symbols will go here
...\Custom Electrical Symbols\Pneumatic            Custom Pneumatic symbols will go here
...\Custom Electrical Symbols\Panel Footprints    Custom Pneumatic symbols will go here

WD_PNL,%SL_DIR%/panel, panel layout symbol library base folder
     This path sets the starting location Electrical uses when searching for footprints. Build a folder structure under this path. Start all paths in the 'footprint_lookup.mdb' from this location.
image
    

*WD_CIRCBUILDER_FNAM,"ace_circuit_builder.xls",Circuit Builder spreadsheet file name
     This row links Electrical to a custom named Circuit Builder spreadsheet. Remove the asterisk from the beginning of the line and type in your new spreadsheets name.

*WD_INSCOMPDLG,x:/some path/,to override starting path for INS SCHEM COMP browse button
     This changes the starting path used when pressing the browse button on the Insert Schematic Component dialog.
image

*WD_INSFPDLG,x:/some path/,to override starting path for INS PNL COMP browse button
     This changes the starting path used when pressing the browse button on the Insert Panel Component dialog.
image

*WD_INSCKTDLG,x:/some path/,to override starting path for INS CKT file selection dialog
     This changes the starting path used for the Insert Saved Circuit dialog. If this is not set, Electrical defaults to the 'User' folder.
image    image

*WD_WBLOCKDLG,x:/some path/,to override starting subdir for Black Box Bldr WBlock option
     This changes the default file path for blocks when using the Symbol Builder.
image

*WD_PICKLIST,%WD_DIR%/catalogs/wd_picklist.mdb,ins component from catalog list file
     This line sets the path and name of a custom catalog list file. If this path is not used, 'wd_picklist.mdb' from the default catalogs folder is used. This database can be edited manually using Access or through Electrical using the Add/Edit buttons in the Catalog List dialog.
image     image

*WD_USERCKTDIR,x:/some path/,default folder for "USER CKTS"
     This sets the save location for the new user circuit block that is created when using the add 'New Circuit' wizard.
image    image
image

*PLC_ADDRESS_FORMAT,I:00%10%2;I:%1%2/00;--;O:00%10%2;O:%1%2/00;--;,default PLC address formats for "Quick pick"
    
This line lets you set the default PLC address formats in the I/O Address drop down menu. In the example below I added TEST:%1%2
PLC_ADDRESS_FORMAT,I:00%10%2;I:%1%2/00;--;O:00%10%2;O:%1%2/00;--;TEST:%1%2,default PLC address formats for "Quick pick"
image
    
************************************************************************************
* Catalog Parts Database Path
************************************************************************************
WD_CAT,%WD_DIR%/catalogs/,AE catalog file path
     This is the location of  the following databases. These should be shared between all users.
image
 
*WD_XCAT,x:/some path/wd_xcat.lsp,to override catalog look-up and call user's external routine
     Per the comment at the bottom of this post... Overrides the default catalog look-up and instead uses this LISP routine. A sample LISP named wd_xcat.lsp is in the default support folder. There are many comments in this LISP describing its use and function to help you customize it.

Runs an external LISP routine to retrieve the footprint block name and catalog data. This button is only found on the Insert Footprint from Schematic List and the Insert Footprint from Equipment List dialogs.

************************************************************************************
* Project and drawing-related paths and settings
************************************************************************************
WD_PROJ,%WD_DIR%/proj/,AutoCAD Electrical default project data folder
     This is the default save location for new projects. Point this to the folder on the network where all your projects are stored. That will eliminate several clicks each time a new projects is created.
image

*WD_PICKPRJDLG,x:/some path/,to override starting subdir for "PICK PROJ" button
     This sets the default open location when browsing for projects. Again point this to the folder on the network where all projects are stored.
image

*WD_OPEN_DWG,(command "_.ZOOM" "_E"),AutoLISP prog or expression to autoexecute when dwg opened from PROJ dlg
     This is a handy little utility that allows a simple command, or an entire LISP, to run at file open. The example they are showing will run a zoom extents on every drawing right after its opened. Simply remove the asterisk and this line will run. I sure you can find several other good uses for this.

*WD_ZIP,c:/program files/winzip/winzip32.exe,full path/name of zipping utility executable
*WD_ZIP,c:/program files/WinRAR/rar.exe, full path/name for alternate zipping utility
     Under Plot Project is a neat little utility that will ZIP all project related files into a single ZIP file. However this utility requires an actual zipping program. Use/modify one of the above paths to let Electrical know what program you use and where its located.
image

*WD_PROMPT_SAVE,1,set to 1 to trigger "Save changes" prompt when using open dwg next/prev arrows buttons
   Remove the asterisk from this row and the Next/Previous buttons will prompt for a Save if there are any pending saves needed. After pressing Yes or NO the drawing will close and move on to the Next/Previous drawing. With this row commented out (*), Electrical saves automatically if there are pending changes.
image       image

************************************************************************************
* Plotting & Reporting Path
************************************************************************************
WD_DWF_PC3,DWF6 ePlot.pc3,alternate "dwf" plotter config pc3 file reference
*WD_JPG_PC3,PublishToWeb JPG.pc3,alternate "jpg" plotter config pc3 file reference
*WD_PNG_PC3,PublishToWeb PNG.pc3,alternate "png" plotter config pc3 file reference
     The three rows above allow setting default .pc3 names for printing to DWF, JPG, and PNG. Electrical will look in AutoCAD's default .pc3 folder for these files. If you plan on using these, be sure to set everyone to a network location in AutoCAD's Options as well.
image


*WD_PLOT2FILEDIR,x:/some path/,target dir for AutoCAD Electrical's Batch Plot to File
     When printing to a PDF, DWF, JPG, ect. Electrical needs a place to drop the files. Typically you end up searching around for the files after their created. The default path if not using this line is My Documents.

*WD_SAVE2FILEDLG,x:/some path/,default save directory for reports
     Set this path to have a default directory for any reports saved out to a file. The default without using this line is My Documents.
image


*WD_SET_FILES,x:/some path/,folder for report ".set" files
    
This path is often overlooked. Report settings files should have their own folder on the network. Electrical uses the 'User' folder by default.
The Automatic Report Selection dialog automatically pulls from this location. The other report dialogs will have a Format button that looks to this path for any relevant .set files.
image    image

************************************************************************************
* Menu & Slide Path
************************************************************************************
*WD_MENU,%DS_DIR%/my_menu.dat,to override default schem icon menu
     This row allows a custom name and path for the schematic icon menu.
image     image
Remember to press the Default button on the Project Properties row after changing this path.
image

*WD_PMENU,%DS_DIR%/mypnlmnu.dat,to override default panel layout icon menu
     This row allows a custom name and path for the panel icon menu. Again, remember to press the Default button on the Project Properties row after changing this path.
image     image

*WD_SLB,x:/some path/,to override path pointing to ".slb" slide lib support files
     New icon menu images will default to this location. Remember to move the original slide libraries (.slb) to this location as well.
image
Remember to move the original slide libraries (.slb) and their .dll's to this location as well. The
image  image

************************************************************************************
* Misc
************************************************************************************
*WD_SUP_ALT,x:/some path/,to include an alternate support path (searched before normal AutoCAD Electrical support path)
     This is where I set my support path. This path is searched BEFORE the one listed at the beginning of this document. By having two support paths you can place ONLY what has been modified on the network. The rest of the files continue to pull from the users local drive. Typical things that would go into this directory would be: .wdl, .wdt, .loc, .inst, .wdd, ect.

*WD_ACADPATHFIRST,1,if 1 then check ACAD path first before AutoCAD Electrical paths
     If your using the we.env file correctly, I have a hard time finding a reason for this line. In any case, if you need the AutoCAD support paths searched before the Electrical paths remove the asterisk from the front of the row.

*WD_SCR_DLG,x:/some path/,to override starting path for SCRIPT file selection dialog
     A number of dialogs have the option to call to an outside script. This path allows you to set a default path to those scripts. The default is the 'User' folder.
image


WD_MSG,ENU (English-US),map internal prompts and messages to specific language column in wd_msg.mdb file
     This row sets what language should be used in prompts and messages. The wd_msg.mdb files its in the install location\support. Other choices are ESP (Spanish), DEU (German), ITA (Italian), JPN (Japanese), CHS (Simplified Chinese), FRA (French).
This database may need custom modification. The JPN and CHS columns are completely empty in my database. Many of the rows only have English.
image


*WD_LASTSURF,%DS_DIR%/user/lastsurf.tmp,extern text file listing last surfed item
     Creates text file with info from the last item that was surfed on.
image
*WD_PRINT_FONT,"Courier New" 10, Dialog's PRINT report font name and optional point size. Put quotes around multi-word font names (ex: WD_PRINT_FONT,"Times New Roman" 10)
     This sets the font name and size when printing a report directly from the report dialogs.
image

*SETQ:GBL_wd_qsok,1,Project database freshen operations: 1=suppress prompt for QSAVE
     This is another time where Electrical auto-saves. Using this line will have Electrical prompt you if there are any pending saves.

*SETQ:GBL_wd_backup_prompt,1,ZIP backup prompt before project-wide operations: 1=prompt for backup
     If this line is used you will be prompted with the following dialog every time a project wide function is performed. Pressing 'Create Backup' will use the zip utility defined above to (zip) backup the entire project.
image

*SETQ:GBL_wd_green_x_at_connection,0,Insert wire - dynamic green x's at connections: 0=suppress
     Tired of seeing the green x's when inserting a wire? Using this line will turn off that feature.
image


*SETQ:GBL_wd_xref_mtext_pinfont,"romans.shx",graphical cross-references - font for the "terminal pin" text
*SETQ:GBL_wd_xref_mtext_pinsize,"0.67",ratio pin/reference text size
     These two rows set the font and font height for the graphical format type contact pin data. In my example below I am showing Arial.
image
image

*SETQ:GBL_wd_wnum_noduplicate_chk,'("GND" "24VDC" "COM")
    When this line is used, any text string listed is ignored by the duplicate wire number check. For example now all motors can have a 'GND' wire and Electrical will not complain or try to renumber them. 
image    image

*SETQ:GBL_wd_colga_leaderlay,"SYMS"
*SETQ:GBL_wd_colga_textlay,"MISC"
     These two set the default layers for the leader and text used in the Wire Color/Gauge Label command.
image       
image

*SETQ:GBL_wd_break_parameters,'(0.85 40.0), distance ratio/angle for PLC I/O and connector jagged break lines
     This line drives the defaults for the jog in PLC breaks.
image

*SETQ:GBL_wd_default_plot_outputdevice,"Default Windows System Printer.pc3", Default output device
     For the life of me I can't figure out what this line does. If anyone knows please comment and I'll update this post.

*SETQ:GBL_wd_importdbUppercase,0, if 0 then Import from Project Database unchecks Force values to upper case
     As values that are wrote back into the schematic from the scratch database are automatically capitalized. The only time this would be a problem is when making outside changes to the scratch database and then writing them back into the project. If any of those changes were lowercase they would be pushed into the project as uppercase. Enable this line and those values would honor their original case.
image

And that my friend is a complete break down of the wd.env file.

5 comments:

  1. Hi Stan.

    I really like your posts. Not many good AcadE resources left on the internet.
    However.. I belive you're wrong about the WD_XCAT.
    This variable makes you able to use an external LISP-program to do a catalog lookup (when pressing the lookup-button in the Edit Component/Footprint dialogs.)

    THL

    ReplyDelete
  2. After digging deeper on that line I do believe your right. Once I find some time to run some tests I’ll rewrite that section and give you credit for catching my error.

    ReplyDelete
  3. Hi Stan, superb post. Not enough of these on the web IMO - I have to say i've never found anywhere that describes this file in as much detail.

    One slight problem though. I've tried to modify the PLC_ADDRESS_FORMAT line to add in some double dashes and my own format and although my addresses come near the top of the list, all the original addresses in the list are still present and I cannot see any double dashes :(

    Do you have to make any other changes?

    ReplyDelete
    Replies
    1. Are you sure you removed the * from the front of the PLC_ADDRESS_FORMAT code? I just tried this on 2015 and it worked fine. My double dashes showed as well as any new formats. Also really look close at the separators. I semi colon and colon switched around can mess the whole thing up.

      PLC_ADDRESS_FORMAT,I:00%10%2;I:%1%2/00;--;O:00%10%2;O:%1%2/00;--;TEST,

      Delete
    2. Looks like ACADE threw a wobbly. After restarting the computer all looks fine!! Thanks for your help.

      Delete