×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Add revision to publish filename (pdf and dxf)

Add revision to publish filename (pdf and dxf)

Add revision to publish filename (pdf and dxf)

(OP)
Hi,

I'm wondering if it is possible to automatically include a parameter value in a published filename,

00001.drw  ,  parameter REVISION = 03

output PDF as :

00001-R03.pdf

I've tried this using macros without any success, has anyone done anything like this, do you need to use pro-toolkit?

Thanks

Dave.  

RE: Add revision to publish filename (pdf and dxf)

Hi

I have made something similar using a mapkey and a small
program and using batch script doint the rename

It result in the pdf to be named 00001_03.pdf
We are using letters i.e. it would be 00001_A.pdf

It has been used with both Ilink 34 and PDM Link 91

The mapkey export a file with all parameters
plot the pdf, then the parameter value is read and
used for a dos rename of the file.

Currently it works for WF5 but has also worked with WF2 & WF4
but with a slightly different mapkey (change in UI in WF5)

BR Niels

RE: Add revision to publish filename (pdf and dxf)

(OP)
Hi NeilsC,

That sounds like what I'm trying to do, I'm new to scripts though,

can the batch script be run as part of the macro or does it have to be run separately? The parameter file exported from the part is quite large, how does the script pick out the correct value?

could you post a copy the mapkey code and script that I could modify to suit my system? I should be able to pick up enough from tutorials to change a batch script but am a bit lost on how I would start from scratch.

Thanks for your help,

Dave.

RE: Add revision to publish filename (pdf and dxf)

Hi

I have attached a zip with 4 files - working with WF5 (do have for WF4 also)

It is simple and home made and could be improved but it works.
The idea is to read the parameter from an exported file and
generate a simple bat file that renames the pdf file


You will need to have 'standard' pdf creation ala ghost script
installed (i think - at least i have)

I use the pdf.pcf for printer definition that calls the makepdf.bat normally placed in a plot_config folder

The config.pro is the mapkey for creating a export file with the temp name @rev_info.txt with the parameters into a folder called C:\PLOT
then printing the pdf file into the C:\PLOT\ folder (i think this can be done without ghost script pdf but have not tried)

but the current pdf is created through calling the makepdf.bat
that execute the ilink_revision.exe file (my own gooffy program)

that search the @rev_info.txt (hard coded) for the parameter
(any choise) using the filename (%OUTNAME%) from the creation of the pdf

ilink_revision.exe %OUTNAME% PTC_WM_REVISION C:\PLOT

This create a simple bat file called c:\plot\@rev.bat
that must be executed for renaming to filename_rev.pdf

I do not know if this is clear and i have not checked
without ghostscript but feel free to play smile

BR NielsC
 

RE: Add revision to publish filename (pdf and dxf)

(OP)
Hi NielsC,

I've been doing a bit of work on this and have managed to get it to work using a .BAT file that will add the revision to the filename on .dxf and .pdf files for it to work you have to

-create folders c:\dxf, c:\pdf and c:\publish_workspace


-create revname.bat(see below), and copy to c:\publish_workspace\

-record a mapkey that is set to export a dxf or pdf or both files to c:\publish_workspace (or any name that ties up with the batch file)also exporting the drawing parameters in .txt format to the same folder finish the mapkey by manually adding this line to its end :

mapkey(continued) @SYSTEMstart c:\\publish_workspace\\revname.BAT;



REVNAME.BAT
----------

for /F "usebackq tokens=2" %%a IN (`findstr PTC_WM_REVISION C:\PUBLISH_WORKSPACE\*.txt`) do (
  SET Rev=%%a
)

FOR %%S IN ( c:\publish_workspace\*.DXF) DO (SET FILE=%%S)
set noext=%file:~21,-4%
ren %file% %noext%-R%REV%.dxf
REN C:\PUBLISH_WORKSPACE\*.PDF ?????????-R%REV%.pdf
move c:\publish_workspace\*.dxf c:\dxf
move c:\publish_workspace\*.pdf c:\pdf
del c:\publish_workspace\*.txt
del c:\publish_workspace\*.log*
EXIT

---------

Thanks for all your help on this, I would never have got it done otherwise.
 

RE: Add revision to publish filename (pdf and dxf)

Hi Dave

impressive batch programming - was not aware that i could search
for the parameter throuh batch.

I would prefer to do this for one file only and not all in the folder.

Guess i can alter the makepdf.bat to do that

NielsC

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources