Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X
In our small company (6 designers) we have found it beneficial to date and time stamp the lower right corner of drawing format just outside the border. Years ago we had a CAD system that when you entered the text #date, #time, etc it would enter the system date and time. We have been using Pro/E since Rev 18 or so and gotten away from it, but now management would like to look into bringing it back. Does anyone know of a way in Creo to do this? It would be even better if it were totally automatic when you save the file. Thanks.
Bruce
I searched before I posted and came up empty, after I entered my post I saw "similar posts" which helped a little. In annotation, entering "&todays_date" does cause a text entry of the system date. So that is a step in the right direction. Is there a way to get the sytem time also? And also, any way to get the system to automatically enter this upon saving?
Thanks again.
Bruce
You can use: "&todays_date", but that works only when you insert it, and doesn't update. You can put that as variable text in a symbol, and then when you do a "properties" on the symbol, it will update without you actually having to change it.
You can use: &PTC_WM_MODIFIED_ON:D, but since that is a parameter created by windchill, you have to save the dwg, check it in, then do and "update" to get it to change. This parameter can also be used as variable text in a symbol.
What I did was created a symbol that had "&todays_date" and a parameter I created in the dwg: "&DWG_TODAYS_DATE" which I manually changed, but then after an update automatically changed all the occurrances on all the sheets.
Good luck.
Honestly Bruce I think you can do this when you export to PDF. I think you can add the timestamp but I haven't tried it myself. I've seen the option though.
Also... how are you creating your prints. Are you just printing manually or through some sort of script. Are you printing directly to the printer or are you generating PDF's?
I am short on time for the next two weeks but I think there are several options here.
Thanks!
-Brian
Hi Bruce...
The Label function in the printer panel still works well- even at Creo 2. But, from my understanding, you want this stamp every time you SAVE the drawing?
While I'm confident you can do this... I think it's overkill. In the past you could do this during a print operation... and you indeed still can. But during a SAVE operation? Egad.
Multiple people have suggested the "todays_date" variable. There are no other good variables other than the ones Frank and others have already given. However, you can always pull data from your operating system. If you needed to, you could put your username, workstation/computer name, date, time, timezone, and a million opther pieces of information on the drawing. You just need to pull them from the OPERATING system, not from Creo.
I can think of a couple of ways to do this... but I need to think on the easiest method to do it. You need to execute a system command and then capture the output so you can use it in Creo. I can do it with a small script but I'd like something easier. Either way, if you want this to update at each save, you're probably going to have to do one of two things:
This sounds like a very long way around the barn. Can you live with the built-in print date stamp function... or do we need to dig into a more complex solution?
Thanks!
-Brian
Interesting Brian, I didn't know there was a time stamp for the PDF. I'll have to check that out, thanks!
For us, I want the date on the deg itself so that anyone pulling the dwg knows when it was created. I made a "PRELIMINARY" symbol, and put all 3 of the parameters i mentioned in it so the user can choose. I actually just thought of using the: "&PTC_WM_MODIFIED_ON:D" instead of the: "&todays_date" after seeing this thread. I knew the parameter existed, just never played with it. I don't like that you have to save first then check in, then update, but, it DOES automatically change all the sheets and adds the time, and is always correct vs. using the created parameter: "&DWG_TODAYS_DATE" which I have to manually add, though it changes all the sheets.
So, it looks like Bruce now has a bunch of options.
Thanks for the helpful answers, and ideas. We plot from the pdf file. Our main goal is when we create the pdf file we would like the system date and time stamped on both the plotted file, and the electronic drawing file itself so those two could always be compared down the road. For example, if in 6 months a revision is required one would look at the redlined print and see a date / time, then pull the file off the server and compare the two. There have been cases where an earlier version gets on the server, and not the latest plotted version. Our drawings can get plotted several times, sometimes several versions in a day before fianlly being released.
Our problems seem to stem from us relying on a self enforced back up system, not a PDM system that automatically backs up files.
This discussion has raised some issues I had not thought of previously, for example, if I open a file just to look at it I wouldn't want it updating the date. Let me discuss this a bit more at this end to determine all our requirements and possible conditions.
Bruce
That's what I figured, to synch both the PDF and e-files. Exactly why I do it with the symbol for preliminary dwgs (only, others are under rev control). I'm going to be putting that variable in our modified formats as a clue, and also the baseline info.
Our problem stems from having two different versions of the same rev. It's our system that lets the users do it, and if they aren't disciplined, or forget, we have been bit. Reading this and thinking about it, it's amazing we don't get bit more often. I guess we have low turnover in a small group.
Bruce
Hello Bruce and others,
is the problem unsolved until now, or is my english to bad?
We have exact the same problem!
(small engineering office, no pdm-system)
We want, that the date of plot togehter with the clocktime is printed onto the pdf
at a formated state at the title block.
And we want that it is also at the same place at the drw.
When a customer has questions while construction work and later,
we always open the model and the drw.
Then we want back check the date of our drw and that of the customers pdf.
Using Wildfire we have employed the Spekan -Tools / U-tools.
The title block of the drawing containes the string-parameter &Plot_Date
The plot has been done by a mapkey,
which called the function ,splotdate' before generation of the pdf.
,splotdate' was a part of the U-tools
It updated the parameter &Plot_Date.
Afterwards the mapkey generated the pdf
Now we are switching to creo and the U-tools are no longer working!
I think, a function which I can call by a mapkey and which pulls data from the operating system is sufficient.
Not sufficient is a solution, which requires addtional work or which may be forgotten.
With best regards,
H.Steffen
Holger,
No, I still do not believe there is any way to do this yet. We are using Creo 2.0, build M070 and I haven't seen a solution.
If you figure out a mapkey let me know.
Regards,
Bruce
AutoIT is my go-to software for creating solutions to problems like this.
It is easier if there is a drawing parameter or a drawing symbol that is already on the drawing, as opposed to creating a utility that has to detect if there is one there or not.
At one time you could run an OS command from within Pro/E; I assume it is still there. If so then that command can be an AutoIT program that is started by a mapkey. Alternatively, the user could start an AutoIT program that either ran a mapkey or directly drives Pro/E. Or Creo, or whatever PTC marketing renames it next.
If you want, AutoIT can be used to intercept Save and Print - Have a program startup along with Pro/E that waits for a window of the correct title to open - the script hits the Cancel button, does the operations desired, and then re-performs the Save/Print. AutoIT can either then click OK for the user, or drop it and allow the user the option to Save/Print/Cancel.
Similar results can be gotten with Visual Basic, et al. I just find that AutoIT has a lower barrier to entry.
You can do it with two mapkeys, the first mapkey pulls the date and/or time from the OS via an OS script...start a new mapkey and click on the OS script tab. Enter the following:
echo %date% %time% |clip
Close and save the mapkey. The "|clip" portion of the script above copies the command line output to the clipboard. You can remove the time portion if you don't need it. Then create another mapkey that updates the parameter by calling the OS script mapkey above and pastes the information into the field for the date parameter. You may also have to do some further editing with the mapkey to remove the three letter day at the beginning of the date stamp.
The user then just needs to run the second mapkey and all is handled automatically. Hope that helps.
Here's another script you can use and is more customizable:
for /f "tokens=2,3,4,5,6 usebackq delims=:/ " %a in ('%date% %time%') do echo %c-%a-%b %d%e |clip
This will output the date and time in the following format:
YYYY-MM-DD HHMM
You can change what appears and in what order/format the date and time are by arranging the % letters after the echo statement. You can also change the - to something else like / and a colon between the hour and minute again by editing the script after the echo command.
Thank you very much!
I didn't know the possiblity of creating OS scripts.
I will try it tommorow
It's also useful to start external programs. I have mapkeys for my unit convert program, calculator, and windows 7 snipping tool. You can launch external programs with the following script:
start "" %windir%\system32\SnippingTool.exe
exit
Just change the path to your file you want to run. The start "" ....exit allows the command prompt to start the program in another thread and close the command prompt automatically so it doesn't get in the way. The external program still stays active.
This was very helpful to learn a couple of ways to use OS script for mapkeys. Is there any place you know of to learn more information about coding OS script mapkeys?
There is no formal documentation.
"OS script" is just another way of saying batch file or command line. Google batch file commands and there are lots of websites that offer info.
If you want to get serious about batch programming, there's an old but still excellent book:
Windows NT Shell Scripting: Timothy Hill: 9781578700479: Amazon.com: Books
Good websites:
Batch File Scripting Techniques
Of course, these are for good old DOS/Windows batch scripting. There are other, newer scripting languages for Windows -- Windows Script Host (WSH) and PowerShell Script. Depending on what you want to do, they might work better for you. Again, Google can help you out.
Wow - two bits of learning in one day! I never knew you could 'pipe' to Clipboard; and while I've used FOR a few times, that's a completely different use of it.
Thanks!
Hi Eric and other interested.
I said, I will check tomorrow, now it's 2,5 years .....
But now I switched to CREO2 and I tried the way.
The OS script works fine.
But now, I have problems, to transfer the string from the clipboard to the drawing parameter.
I recorded a mapkey, it is documented downwards
(The emoticon at line 3 is not correct it is ; and \ )
As can be seen, there is at line 8 a fix string for the date,
which shouldn't be there!
Does anyone know the solution?
Greetings,
Holger
mapkey spr @MAPKEY_LABELset parameter;\
mapkey(continued) ~ Activate `main_dlg_cur` `page_Tools_control_btn` 1;\
mapkey(continued) ~ Command `ProCmdDwgParameters`
mapkey(continued) ~ Arm `relation_dlg` `ParamsPHLay.ParTable` 2 `rowPLOT_DATE` `value`;\
mapkey(continued) ~ Disarm `relation_dlg` `ParamsPHLay.ParTable` 2 `rowPLOT_DATE` `value`;\
mapkey(continued) ~ Select `relation_dlg` `ParamsPHLay.ParTable` 2 `rowPLOT_DATE` `value`;\
mapkey(continued) ~ Key `relation_dlg` `ParamsPHLay.ParTable` 39190550 `Ctrl+V`;\
mapkey(continued) ~ Update `relation_dlg` `ParamsPHLay.ParTable_INPUT` `07.07.2016-14:31`;\
mapkey(continued) ~ Activate `relation_dlg` `PB_OK`;
mapkey $F2 @MAPKEY_NAMEDate and time;\
mapkey(continued) @MAPKEY_LABELTimestamp;\
mapkey(continued) @SYSTEMecho \%date\%\%time:\~0,5\% > C:\\TEMP\\timestamp.txt;
mapkey $F3 @MAPKEY_NAMENotiz mit einem Zeitstempel aus einer Datei einfügen;\
mapkey(continued) @MAPKEY_LABELNotiz timestamp;%$F2;\
mapkey(continued) ~ Activate `main_dlg_cur` `page_Annotate_control_btn` 1;\
mapkey(continued) ~ Command `ProCmdDwgCreateNote` ;#FILE;#MAKE NOTE;@PAUSE_FOR_SCREEN_PICK;\
mapkey(continued) ~ Trail `UI Desktop` `UI Desktop` `DLG_PREVIEW_POST` `file_open`;\
mapkey(continued) ~ Activate `file_open` `SAB_c:`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `TEMP`;\
mapkey(continued) ~ Activate `file_open` `Ph_list.Filelist` 1 `TEMP`;\
mapkey(continued) ~ Select `file_open` `Ph_list.Filelist` 1 `timestamp.txt`;\
mapkey(continued) ~ Command `ProFileSelPushOpen@context_dlg_open_cmd` ;#DONE/RETURN;