Nate Holt's Blog

September 2, 2010

Semi-auto execution of a ‘User Post’ – AutoCAD Electrical

Filed under: Electrical — nateholt @ 7:18 am

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??

About these ads

7 Comments »

  1. What if I want the report to execute the UserPost WITHOUT pressing any buttons? That would be nice for Automatic reports…

    Comment by Trond Hasse Lie — September 2, 2010 @ 8:51 am

  2. I was waiting for someone to suggest this… not sure it is possible. But will take a look. – Nate.

    Comment by Nate Holt — September 2, 2010 @ 9:06 am

  3. I hope you succeed with the userpost without pressing buttons, this will be a great enhancement for automation.
    The API which is available doesn’t provide that.

    Comment by Gerald — September 7, 2010 @ 3:08 am

  4. Mr. Nate.

    My question has nothing to do with this topic but maybe you could help me.

    I use to change the default TAG to one that our company use, for instance a circuit breaker we name “F1″ (F%N).
    Not a problem but a new client demand to name the component with the same number of the correspondig ladder (it’s logical) – he brought us an excel list, we must draw the single wire diagram.
    They are consecutives but he makes diferences between lighs (begin in 1, no problem I can do it) and power (begin in 101, uff its killing me).
    Is there any way to override the tag format but starting from a diferent number but 1?

    Thanks a lot
    Sorry for my English

    Ernesto Fraga
    Montevideo – Uruguay

    Comment by Ernesto — September 7, 2010 @ 1:51 pm

  5. Mr. Nate

    It is exact what I need, thanks. It is an easy solution that I didn’t realized from the beginning, I though it was going to be harder.

    Best regards

    Ernesto Fraga
    Montevideo – Uruguay

    Comment by Ernesto — September 9, 2010 @ 12:40 pm

  6. Mr. Nate

    This is what I need. I should have done a best personal research before ask you. The solution is very simple.

    Best Regards
    Ernesto Fraga
    Montevideo – Uruguay

    Comment by Ernesto — September 9, 2010 @ 3:08 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Shocking Blue Green Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 32 other followers

%d bloggers like this: