• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

print a table in pdf with the name of the parameter "code"

  • Thread starter Thread starter The X
  • Start date Start date

The X

Guest
save to all, at work use wf4 and pdmlink 9.x and it is a lot of time that I would like to be able to automate the printing of our tables in pdf format making sure that the file produced automatically has the value of the parameter "code" that each part and/or together possesses.

by default the generated pdf has the file name .drw and then I have to manually rename from windows the pdf with the assigned company code, with the risk of typing errors etc.

tell me you can do it!!!!!!! !

Thank you.

p.s. who solves my big problem has a beer paid in Romagna....ehheehhe :biggrin:
 
save to all, at work use wf4 and pdmlink 9.x and it is a lot of time that I would like to be able to automate the printing of our tables in pdf format making sure that the file produced automatically has the value of the parameter "code" that each part and/or together possesses.

by default the generated pdf has the file name .drw and then I have to manually rename from windows the pdf with the assigned company code, with the risk of typing errors etc.

tell me you can do it!!!!!!! !

Thank you.

p.s. who solves my big problem has a beer paid in Romagna....ehheehhe :biggrin:
here you use a procedure to the reverse, in the sense that the code is extracted from the first part of the component name
as below:1234567801_description_bravethe first eight digits indicate the code, the figures in red indicate the revision index and the short description helps somehow in the search.
a report is inserted in the component that extracts the two strings for the code and the revision index.

how to print the pdf and truncate the name ... sincerely I never tried, see if someone has a solution.
If you use a pdm I know that the problem is easy to solve.

b.b.: other than beer you have to pay, here we want money... and in advance:-)
 
dani : I tried to spat with distributed-batch but it seems to me to understand that it is a software to automate a series of inspections....I print it I want to do one at a time and cmq the file that prints the batch has cmq always the name of my table. ..you should understand if within .ttd projects you can set the output file name equal to the value of a variable or parameter. . .

maxopus : in my file (e.g. 123456.prt) I have already created a parameter, called "code" which I hand-check (e.g. bs312512) according to the company code.

what I would like to do is print pdf instead of as 123456.pdf as bs312512.pdf
 
You can do it, but other than beer you have to offer. I'm Swiss, not German! :-)
 
dani : I tried to spat with distributed-batch but it seems to me to understand that it is a software to automate a series of inspections....I print it I want to do one at a time and cmq the file that prints the batch has cmq always the name of my table. ..you should understand if within .ttd projects you can set the output file name equal to the value of a variable or parameter. . .
Unfortunately, I don't know the procedure well, I've just pointed out the old discussion.
 
if someone can come in handy I managed, through bash script, to create a macro to do the operation in question :)
 
tomorrow I set up the macro by putting us qlc comment and then you place it, because being very personalized a minimum you will have to adapt it to vs situation:)
 
eccomi qua, come promesso vi posto le mie 2 macro che con molta fatica sono riuscito a realizzare....

premesse :

1) d:\work_areawf4\dxf_stp_igs --> directory di lavoro (dove vengono salvati i vari files esportati da pro-e)
2) h:\\standard\\macro --> directory dove ho salvato gli script batch
3) opzioni del config.pro da avere --> new_parameter_ui yes --> new_relation_ui yes
---------------------

--------------------------------------------------------------------
! -----------------
! macro principali
! -----------------
! con il modello aperto (prt o asm) premendo questa macro si apre automaticamente la messa in tavola associata ad esso,
! ovvero quella con lo stesso codice-file. (es. 123456.prt --> apre il 123456.drw)
!
mapkey apri_drw @mapkey_nameapri drawind del 3d;@mapkey_labelod_3d;\
mapkey(continued) @mapkey_labelapri drawing del 3d;%exp_param_3d_prt;\
mapkey(continued) @systemh:\\standard\\macro\\estrai_numero_file.bat;%esegui_trail;

! con la messa in tavola aperta, premendo questa macro si esegue la stampa su file (nel mio caso nel formato hpgl) con già il parametro "codice" (codice aziendale utilizzato per identificare univocamente un particolare prodotto) e il tipo di formato !!!
(es. aprendo il 123456.drw con dentro il parametro codice = bc-70123 in formato a4 --> mi crea il file bc-70123_a4.hpgl nella cartella di rete g:\hpgl)
!
mapkey stama_hpgl_a4 @mapkey_namestampa hpgl a4;@mapkey_labelstampa hpgl a4;\
mapkey(continued) %exp_param_asm;%exp_param_prt;\
mapkey(continued) @systemh:\\standard\\macro\\estrai_codice_a4.bat;%esegui_trail;

--------------------------------------------------------------------
! -----------------
! sotto-macro
! -----------------
mapkey exp_param_prt @mapkey_nameesporta lista parametri;\
mapkey(continued) @mapkey_labelesporta lista parametri;~ command `procmddwgparameters` ;\
mapkey(continued) ~ open `relation_dlg` `omcontext`;~ close `relation_dlg` `omcontext`;\
mapkey(continued) ~ select `relation_dlg` `omcontext`1 `part`;\
mapkey(continued) ~ select `main_dlg_cur` `phtleft.assytree`1 `node0`;\
mapkey(continued) ~ select `relation_dlg` `menubar1`1 `file`;\
mapkey(continued) ~ select `relation_dlg` `cascadeexport`;~ close `relation_dlg` `menubar1`;\
mapkey(continued) ~ close `relation_dlg` `cascadeexport`;\
mapkey(continued) ~ activate `relation_dlg` `pbexporttxt`;\
mapkey(continued) ~ trail `ui desktop` `ui desktop` `dlg_preview_post` `file_open`;\
mapkey(continued) ~ select `file_open` `location browser`;\
mapkey(continued) ~ close `file_open` `location browser`;\
mapkey(continued) ~ activate `file_open` `m_pfafs:drives`;\
mapkey(continued) ~ close `file_open` `location browser`;\
mapkey(continued) ~ select `file_open` `ph_list.filelist`1 `d:`;\
mapkey(continued) ~ activate `file_open` `ph_list.filelist`1 `d:`;\
mapkey(continued) ~ select `file_open` `ph_list.filelist`1 `work_areawf4`;\
mapkey(continued) ~ activate `file_open` `ph_list.filelist`1 `work_areawf4`;\
mapkey(continued) ~ select `file_open` `ph_list.filelist`1 `dxf_stp_igs`;\
mapkey(continued) ~ activate `file_open` `ph_list.filelist`1 `dxf_stp_igs`;\
mapkey(continued) ~ activate `file_open` `open`;\
mapkey(continued) ~ focusin `relation_dlg` `paramsphlay.partable`;\
mapkey(continued) ~ activate `relation_dlg` `pb_cancel`;

mapkey exp_param_asm @mapkey_nameesporta lista parametri;\
mapkey(continued) @mapkey_labelesporta lista parametri;~ command `procmddwgparameters` ;\
mapkey(continued) ~ open `relation_dlg` `omcontext`;~ close `relation_dlg` `omcontext`;\
mapkey(continued) ~ select `relation_dlg` `omcontext`1 `assembly`;\
mapkey(continued) ~ select `main_dlg_cur` `phtleft.assytree`1 `node0`;\
mapkey(continued) ~ open `relation_dlg` `omcontext`;~ close `relation_dlg` `omcontext`;\
mapkey(continued) ~ select `relation_dlg` `menubar1`1 `file`;\
mapkey(continued) ~ select `relation_dlg` `cascadeexport`;~ close `relation_dlg` `menubar1`;\
mapkey(continued) ~ close `relation_dlg` `cascadeexport`;\
mapkey(continued) ~ activate `relation_dlg` `pbexporttxt`;\
mapkey(continued) ~ trail `ui desktop` `ui desktop` `dlg_preview_post` `file_open`;\
mapkey(continued) ~ select `file_open` `location browser`;\
mapkey(continued) ~ close `file_open` `location browser`;\
mapkey(continued) ~ activate `file_open` `m_pfafs:drives`;\
mapkey(continued) ~ close `file_open` `location browser`;\
mapkey(continued) ~ select `file_open` `ph_list.filelist`1 `d:`;\
mapkey(continued) ~ activate `file_open` `ph_list.filelist`1 `d:`;\
mapkey(continued) ~ select `file_open` `ph_list.filelist`1 `work_areawf4`;\
mapkey(continued ~ activate `file_open` `ph_list.filelist`1 `work_areawf4`;\
mapkey(continued) ~ select `file_open` `ph_list.filelist`1 `dxf_stp_igs`;\
mapkey(continued) ~ activate `file_open` `ph_list.filelist`1 `dxf_stp_igs`;\
mapkey(continued) ~ activate `file_open` `open`;\
mapkey(continued) ~ focusin `relation_dlg` `paramsphlay.partable`;\
mapkey(continued) ~ activate `relation_dlg` `pb_cancel`;

mapkey exp_param_3d_prt @mapkey_nameesporta lista parametri in 3d;\
mapkey(continued) @mapkey_labelesporta lista parametri in 3d;~ command `procmdmmparams` ;\
mapkey(continued) ~ select `relation_dlg` `menubar1`1 `file`;\
mapkey(continued) ~ select `relation_dlg` `cascadeexport`;~ close `relation_dlg` `menubar1`;\
mapkey(continued) ~ close `relation_dlg` `cascadeexport`;\
mapkey(continued) ~ activate `relation_dlg` `pbexporttxt`;\
mapkey(continued) ~ trail `ui desktop` `ui desktop` `dlg_preview_post` `file_open`;\
mapkey(continued) ~ select `file_open` `location browser`;\
mapkey(continued) ~ close `file_open` `location browser`;\
mapkey(continued) ~ close `file_open` `sab_wtws:||pdmlink|modus_new`;\
mapkey(continued) ~ select `file_open` `location browser`;\
mapkey(continued) ~ close `file_open` `location browser`;\
mapkey(continued) ~ activate `file_open` `m_pfafs:drives`;\
mapkey(continued) ~ close `file_open` `location browser`;\
mapkey(continued) ~ select `file_open` `ph_list.filelist`1 `d:`;\
mapkey(continued) ~ activate `file_open` `ph_list.filelist`1 `d:`;\
mapkey(continued) ~ select `file_open` `ph_list.filelist`1 `work_areawf4`;\
mapkey(continued) ~ activate `file_open` `ph_list.filelist`1 `work_areawf4`;\
mapkey(continued) ~ select `file_open` `ph_list.filelist`1 `dxf_stp_igs`;\
mapkey(continued) ~ activate `file_open` `ph_list.filelist`1 `dxf_stp_igs`;\
mapkey(continued) ~ activate `file_open` `open`;\
mapkey(continued) ~ focusin `relation_dlg` `paramsphlay.partable`;\
mapkey(continued) ~ activate `relation_dlg` `pb_cancel`;

mapkey esegui_trail @mapkey_nameesegui trail;@mapkey_labelesegui trail;\
mapkey(continued) ~ command `procmdutiltrailtrain` ;\
mapkey(continued) ~ trail `ui desktop` `ui desktop` `dlg_preview_post` `file_open`;\
mapkey(continued) ~ select `file_open` `location browser`;\
mapkey(continued) ~ close `file_open` `location browser`;\
mapkey(continued) ~ activate `file_open` `m_pfafs:drives`;\
mapkey(continued) ~ close `file_open` `location browser`;\
mapkey(continued) ~ select `file_open` `ph_list.filelist`1 `d:`;\
mapkey(continued) ~ activate `file_open` `ph_list.filelist`1 `d:`;\
mapkey(continued) ~ select `file_open` `ph_list.filelist`1 `work_areawf4`;\
mapkey(continued) ~ activate `file_open` `ph_list.filelist`1 `work_areawf4`;\
mapkey(continued) ~ select `file_open` `ph_list.filelist`1 `dxf_stp_igs`;\
mapkey(continued) ~ activate `file_open` `ph_list.filelist`1 `dxf_stp_igs`;\
mapkey(continued) ~ select `file_open` `ph_list.filelist`1 `esegui_trail.txt`;\
mapkey(continued) ~ activate `file_open` `ph_list.filelist`1 `esegui_trail.txt`;\
mapkey(continued) @systemh:\\standard\\macro\\ripulisci.bat;
 
and these are the basic batch scripts (windows- ms dos-batch) that perform the extraction of the required data
-------------------
estrai_numero_file.bat :
-------------------

@echo off

set /a counter=1
for /f "tokens=1 delims=_" %%c in ('dir /b d:\work_areawf4\dxf_stp_igs\*_par.txt') do call :loop %%c
goto end

:loop
rem echo %counter%
if %counter%==1 call :writetrail %1
set /a counter=counter+1
goto end

:writetrail
echo !pro/engineer tm wildfire 4.0 (c) 2008 by parametric technology corporation all rights reserved >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo ~ command `procmdmodelopen` >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo ~ trail `ui desktop` `ui desktop` `dlg_preview_post` `file_open` >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo ~ open `file_open` `type`;~ close `file_open` `type` >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo ~ select `file_open` `type`1 `db_4` >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo ~ input `file_open` `inputname` `%1.drw` >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo ~ update `file_open` `inputname` `%1.drw` >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo ~ activate `file_open` `open` >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
goto end

:end
-------------------
estrai_codice_a0.bat :
-------------------

@echo off

set /a counter=1
for /f "tokens=1 delims=_" %%c in ('dir /b d:\work_areawf4\dxf_stp_igs\*_par.txt') do call :loop %%c
find "codice" <d:\work_areawf4\dxf_stp_igs\%codice_file%_par.txt |sort="">d:\work_areawf4\dxf_stp_igs\codice_temp.nfo
set /a counter=1
for /f "tokens=2 delims= " %%c in (d:\work_areawf4\dxf_stp_igs\codice_temp.nfo) do call :loop2 %%c
set /a counter=1
for /f "tokens=1" %%c in (d:\work_areawf4\dxf_stp_igs\codice_finale.nfo) do call :loop3 %%c
del d:\work_areawf4\dxf_stp_igs\*.nfo
goto end

:loop
rem echo %counter%
if %counter%==1 set codice_file=%1
set /a counter=counter+1
goto end

:loop2
rem echo %counter%
if %counter%==1 echo %1 >d:\work_areawf4\dxf_stp_igs\codice_finale.nfo
set /a counter=counter+1
goto end

:loop3
rem echo %counter%
if %counter%==1 call :writetrail %1
set /a counter=counter+1
goto end

:writetrail
echo !pro/engineer tm wildfire 4.0 (c) 2008 by parametric technology corporation all rights reserved >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo ~ command `procmdmodelprint` >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo ~ select `print` `cascadebutton1`;~ close `print` `cascadebutton1` >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo ~ activate `print` `hpgl`;~ close `print` `cascadebutton1 >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo ~ activate `print` `ok` >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo ~ update `print_file` `filename` \ >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo `g:\\hpgl\\%1_a0.hpgl` >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
echo ~ activate `print_file` `ok` >>d:\work_areawf4\dxf_stp_igs\esegui_trail.txt
goto end

:end
</d:\work_areawf4\dxf_stp_igs\%codice_file%_par.txt>
-------------------
ripulisci.bat
-------------------
del d:\work_areawf4\dxf_stp_igs\*.txt
 
I'm sorry, I admit I didn't read all the macro you wrote, I just wanted to ask you one thing:

Does it also work having different folders?
It seems to me that you set up a path to look for the harvests at the table.
 
@dema: I don't understand what you want to ask me....

The two macros work as follows:

1) I extract in a txt file the parameters from 3d or from table setting
2) extract from the txt file the parameter to me necessary (e.g. code) or alternatively echo from the txt file name the file name opened in 3d (e.g. if it is generated 123456_par.txt then 123456 is the name of my file)
3) I create a trail file with the macro that I want to run, using the name of the newly created file (I needed the macros "open drawing" and "print in hpgl" but you can unbalance as you want)
4) I run the macro running the trail file.

end
 
1) d:\work_areawf4\dxf_stp_igs --> work directory (where the various files exported by pro-e are saved)
2) h:\standard\\\macro --> directory where I saved batch scripts
3) config.pro options to have --> new_parameter_ui yes --> new_relation_ui yes
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Does it also work having different folders?
It seems to me that you set up a path to look for the harvests at the table.
@dema: I don't understand what you want to ask me....
I'll change my percorted cheese d:\work_areawf4\dxf_stp_igs? ? because if I have to write the path where he looks for the drawings I change folder several times a day.
 
I'll change my percorted cheese d:\work_areawf4\dxf_stp_igs? ? because if I have to write the path where he looks for the drawings I change folder several times a day.
Sorry but you work with a pdm if you then we do not use it we cannot use your macros.. .

thanks the same
 
eh understand....also we also work with orders but having pdmlink ns work directory on filesystem we fixed it on d:
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
ciao
Back
Top