Summary: Modify the report’s dialog control file (DCL file) to auto-select and semi-auto launch report post-processing (i.e. ‘User Post’). This should work on any AutoCAD Electrical report that has a ‘User Post” button option.
Eliminate repetitive picks
Let’s say that you often have the need to run AutoCAD Electrical’s Cable From/To report. It displays the extracted / formatted data in the report dialog. But you always need to format in the unused / spare conductors into the report. This means you must pick on the “User Post” button. Then you find the “unused core/conductors” toggle and turn it ON. Then you hit OK and the spare conductors get pushed into the display report.
But wouldn’t it be nice if this third toggle was turned “ON” by default? It would save one of the repetitive picks you do every time you have to run this particular report.
And one step better… let’s say that you ALWAYS choose this 3rd option for Cable From/To reports. None of the other options are ever used. Wouldn’t it be nice to just skip this option dialog altogether? You just hit “User Post” and that’s it? No dialog pops up, no selections required… the unused conductor entries just appear in the report the moment you pick on the “User Post” button.
Here’s how to do it.
Enhancement #1 – pre-selecting one or more options in the ‘User Post’ dialog.
Step #1 – Find the file name of the user post utility for the target report type.
Run the Cable From/To report and hit the “User Post” button. Cancel out. Now look at your command window. The full file name of the post-process utility is displayed here.
Step #2 – make a BACKUP copy of this file. Just in case.
Step #3 – open this file with any ASCII text editor (example: Wordpad.exe) or open with the Visual Lisp editor built into AutoCAD (type VLIDE [Enter] at the “Command:” prompt). You are looking at an AutoLISP program. There is one of these for every AutoCAD Electrical report type.
Scroll down to an area of the program that more or less looks like what is shown below.
We want to have the 3rd toggle option be set by default when the User Post options dialog displays. Carefully edit the line shown below. Change the “0” to a “1”.
Step #4 – Save the file and test. Rerun the report. Select “User Post” button. Now you should see the 3rd toggle pre-selected ( ! )
Enhancement #2 – Pre-select and totally suppress display of the options dialog.
You can go the next step below if you always run option #3 for the Cable From/To report and never anything else.
Again, let’s be clear… as soon as the “User Post” button is selected, you want the unused conductor data to instantly pop in. It all happens with just a click of the “User Post” button.
If that’s what you want, reopen your edited file above. Carefully “comment out” the lines of code shown below. To comment out a line, just add a semicolon (; )character at the beginning of each line. What you are commenting out is the code that pops open the small options dialog.
The net effect here is that you are pre-setting a variable “user_3″ with the value of “1” that normally gets set by the dialog when you select the 3rd option and hit OK. So, you set it ahead of time in the program, skip calling the dialog (commented out), and then let the rest of the AutoLISP program do its normal thing.
If this doesn’t give expected results or you want to restore the previous behavior, just overwrite the edited lsp file with the backup you made in Step #2… you did make a back-up, right??