Script for Reports

Script for Reports

FRFR1512
Enthusiast Enthusiast
1,224 Views
1 Reply
Message 1 of 2

Script for Reports

FRFR1512
Enthusiast
Enthusiast

Dear Friends

Where can I get a documentation, explanation or code snippet, how to add a script file to the Report generator

If I understoud that right, it's only possible for save to an oder file, and not inserting the table in the drawing.

SF.PNG

My Topics is:

Get an excel file where I have Cable Catalog number, and I need to have Total lenght per cable CatalogNumber

The lenght of each cable is in a RATING attribut

I hope this is possible with the Script, but the helpfile is not very useful.

Thank's

0 Likes
Accepted solutions (1)
1,225 Views
1 Reply
Reply (1)
Message 2 of 2

jtoverka
Advocate
Advocate
Accepted solution

If you click "Run Script" and save the file you will get the dialog box below.

Capture.PNG

The file path to this "Print" script file is below.

C:\Users\%userprofile%\AppData\Roaming\Autodesk\AutoCAD Electrical 2018\R22.0\enu\Support\User\PRINT.SCR

Simply change the year and version to your system. This is what the file says.

 

 

; Script file to call external ".bat" batch file or
; ".exe" program and pass the last written report file.
; syntax:  wd_scr_startapp "<program>"
;   where <program> is the system level batch ".bat" file
;   or external program ".exe" to run. The name of the 
;   last written report is passed with the <program> name
;   as a command line parameter. For example, if the called
;   program is "wdprint.bat", then the last written report's
;   file name is passed as a command line parameter and is
;   accessible within the ".bat" program as "%1".
;
; If full path for program is given, enter it normally 
; (i.e. single backslashes). If the full path is not given,
; WD will search for the target program in the normal WD 
; search paths and ACAD paths. If not found, it also looks
; in \Program Files\Accessories, \Program Files\Windows NT\
; Accessories, \Program Files\Microsoft Office\Office\ and 
; a few other possibilites for the target program.
; 
wd_scr_startapp "wdprint.bat"
; ^C to trigger a bogus command and force the end of the 
; script with no possiblity of repeating the above command
^C

This will require you to create a batch file or other program to process the data.

 

 

I don't think this is what you are looking for. Your best option would be the "User Post" Button on the Report Generator dialog box. The files for these are located here:

C:\program files\autodesk\autocad 2018\acade\support\en-us\shared\

Again, change the year to your system.

 

Inside that folder are lisp files and dialog definition files. You can change both to accommodate more than three user post operations. Otherwise, you would only modify the lisp file. The lisp file has documentation on what variables hold the report data. You can use VLIDE and load the lisp file and read the data in the variable in real time.