Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Has anyone figured out how to show the original PTC_WM_CREATED_ON Windchill system attribute on a drawing without the time stamp and not updating everytime the drawing is checked in?
We have created a Site Level attribute in Windchill named HW_WM_CREATED_ON in Windchill that removes the timestamp.
We cannot figure out how to stop the attribute from updating at check in.
I would have to believe we are not the only company that wants the original created on date from Windchill in the title block of drawings?
Any and all help is appreciated.
John,
see https://support.ptc.com/appserver/cs/view/solution.jsp?source=subscription&n=CS197520
Martin Hanak
Hi Martin,
Thanks for the quick reply.
I had found that workaround, the problem is the time stamp is still showing. Our use case is to show the date only.
Basically you're stuck with using dead text. We have a parameter in our models that designers just manually fill in the first time the drawing is created.
There are games you can play with relations, but I'm not sure they're worth the effort since they would need to either be manually added to each model or present in your start parts before the models are created. Something like this:
1.) Set the config.pro option "date_type_parameter_format" to "%mm-%dd-%yy" (or whatever format you prefer).
2.) Create a custom string parameter to store the original date. (ex. "DATE_CREATED")
3.) Add the following relations to each model to populate the date:
IF DATE_CREATED == "" | DATE_CREATED == " "
DATE_CREATED = PTC_WM_CREATED_ON
ENDIF
We did it at a prior company by adding relations to the start parts.
/* DRAWING PARAMETERS
/* ------------------
/* DATE PARAMETERS FROM WINDCHILL
/* ------------------------------
/* EXTRACT THE DATE PORTION OF THE WINDCHILL TIMESTAMP PARAMS
SHORT_CREATED_ON = EXTRACT(PTC_WM_CREATED_ON,1,10)
SHORT_APPROVED_DATE = EXTRACT(IR_APPROVED_DATE,1,10)
SHORT_MODIFIED_ON = EXTRACT(PTC_WM_MODIFIED_ON,1,10)
YEAR = EXTRACT(PTC_WM_MODIFIED_ON,1,4)
/* INITIAL RELEASE PARAMETERS
/* SET IR_INITIAL VALUES FOR DRAWING PARAMETERS FROM WINDCHILL
/* ONLY WHEN REV IS 0
if PTC_WM_REVISION == "0"
IR_INITIAL_CREATED_ON = SHORT_CREATED_ON
endif
In the titleblock for the date created field we used IR_INITIAL_CREATED_ON. It is updated only if the part revision is 0. Any new part created from the start part template or saved as from an existing part would get the current date in the title block when the rev was 0 only.
I would rather suggest to customize the attribute delegate service. So the attribute is being synchronized with the creation date in Windchill. You can read the very first checkin date and user and synchronize it with the cad model or drawing. Also the attribute is not editable in Creo or Windchill.
This is a customizing but runs since almost ever in PDMLink.