|
How to Update the Drawing System Parameter &todays_date Before Printing
by Ceferino Sanchez of ASTEC Power, a Division of Emerson Network Power
The drawing system parameter &todays_date becomes a nonparametric note after placement as either a note or a table cell entity in a drawing form. Suggestions from the Pro/ENGINEER forums include placing the drawing form with the parameter &todays_date just before printing, but this is not always practical if revisions follow. This tip provides a method for semi-automating &todays_date in Pro/ENGINEER Wildfire 2.0 to reflect the date of the host computer prior to printing.
1. Select Format, Symbol Gallery, Define to create a symbol named DATESTAMP, with only the variable text set to the preset value of &todays_date.
2. Select Insert, Note, Make Note.
3. Type in “date” with backslashes so the symbol recognizes it as a variable text. (Text Style in this example is isofont.)
4. Define the symbol attributes.
5. Define Allowed Placement Type.
6. Define the Preset Values for the variable text as &todays_date.
7. Store the symbol DATESTAMP in your symbol directory.
8. Select Insert, Drawing, Symbol, Custom to insert the symbol into the drawing. Alternatively, you can create start drawing templates with this symbol already placed and added in a layer named DATESTAMP. This lets you blank out the date when it is not required for printing. In the example below, the config option todays_date_note_format is set to %dd-%MMM-%yyyy.
9. Place the symbol.
10. In the newly created layer DATESTAMP, include the symbol DATESTAMP.
11. Verify that the layer DATESTAMP contains the symbol DATESTAMP.
12. Create a mapkey to be saved in the config.pro that updates the variable text in the symbol. The trick here is to find the symbol in the drawing, edit its properties, and click OK without doing anything else in the Symbol Properties dialog box. Doing so updates the variable text to the date of the host computer. Make sure you only have one DATESTAMP symbol in your drawing or the mapkey will not work. Select Tools, Mapkeys, New and then create the mapkey ‘ud’.
13. Start recording with CTRL+F and enter parameters as shown below.
14. Continue with Find Now, then move the found symbol to the selected column, and close the Search Tool box.
15. Continue with Edit, Properties.
16. Click OK on the Custom Drawing Symbol dialog box.
Below is the mapkey as recorded in config.pro:
mapkey ud @MAPKEY_LABELUpdate Datestamp;\
mapkey(continued) ~ Activate `main_dlg_cur` `ProCmdMdlTreeSearch.edit_t`;\
mapkey(continued) ~ Open `selspecdlg0` `SelOptionRadio`;~ Close `selspecdlg0` `SelOptionRadio`;\
mapkey(continued) ~ Select `selspecdlg0` `SelOptionRadio`1 `Drawing Symbol`;\
mapkey(continued) ~ Open `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList`;\
mapkey(continued) ~ Close `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList`;\
mapkey(continued) ~ Select `selspecdlg0` `ExtRulesLayout.ExtBasicNameLayout.BasicNameList`1 \
mapkey(continued) `DATESTAMP`;~ Activate `selspecdlg0` `EvaluateBtn`;\
mapkey(continued) ~ Activate `selspecdlg0` `ApplyBtn`;~ Activate `selspecdlg0` `CancelButton`;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `Edit`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `Edit.psh_dwg_props`;\
mapkey(continued) ~ Activate `drawing_sym_asynch` `OK_modif_push`;
17. You can prefix this mapkey to your printing mapkey so that your drawing will have this persistent datestamp. In this case, I appended the ‘ud’ mapkey before the Plot to PDF mapkey.
The example below is the single-sheet PDF print mapkey. The batch file, plotpdf.bat, renames the plt file to a ps file, then calls the postcript file and runs the PDF program (e.g., Adobe Distiller). The following is just one of several ways to implement the printing mapkey, which will depend on your company standards. If you hide the layer DATESTAMP, the ‘ud’ mapkey will still update the variable text but the symbol will not print.
18. With a drawing in the active window with the symbol DATESTAMP, go to Tools, Mapkeys, New and create the mapkey @plotpdf. Highlight the graphics window and type ‘ud’ to activate the Update Datestamp mapkey.
19. Start with CTRL+P and then choose the parameters shown above.
20. Continue with this menu tab and choose parameters as shown.
21. Continue by clicking OK on all windows and then enter the operating system script.
22. Below is the Print to PDF mapkey prefixed by the ‘ud’ mapkey.
mapkey @plotpdf @MAPKEY_NAMEPlot a single sheet drawing file as PDF full \
mapkey(continued) scale;@MAPKEY_LABELPlot Single Sheet PD&F;%ud;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `File`;~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `File.psh_print`;~ Select `print` `CascadeButton1`;\
mapkey(continued) ~ Close `print` `CascadeButton1`;~ Activate `print` `Generic Postscript`;\
mapkey(continued) ~ Activate `print` `ToFile`1 ;~ Activate `print` `ToPrinter`0 ;\
mapkey(continued) ~ Activate `print` `Configure`;\
mapkey(continued) ~ Select `print_config` `r_opt_ctrl`1 `Model_sheet`;\
mapkey(continued) ~ Open `print_config` `o_plot`;~ Close `print_config` `o_plot`;\
mapkey(continued) ~ Select `print_config` `o_plot`1 `Full Plot`;\
mapkey(continued) ~ Update `print_config` `o_plot` `Full Plot`;~ Activate `print_config` `OK`;\
mapkey(continued) ~ Activate `print` `OK`;~ Activate `Print_file` `OK`;
mapkey(continued) @SYSTEMstart w:\\\\pro_stds\\\\batch_files\\\\plotpdf.bat; 
Ceferino Sanchez is lead engineer and Pro/E administrator at ASTEC Power, a division of Emerson Network Power in Quezon City, Philippines. He can be reached by email at ceferinosanchez@astec-power.com.
|