Cancel
Showing results for 
Search instead for 
Did you mean: 

Format a date in BMIDE

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor

I have a problem. Customer is using Creo integration. When we set creation date in mapping file and put this variable on a drawing, date and time is shown. Customer does not want that also time is showing. I asked GTAC and they said that this is enchancement so I believe it will take time until this is solved.

Because of this I need to find some workaround. 

Do you know if there is some OOTB option with which I can format date on a property in BMIDE?

Or is the only option to do this with ITK? If this is the only option maybe someone already has code for this?

 

Thanks

9 REPLIES 9

Re: Format a date in BMIDE

Siemens Valued Contributor Siemens Valued Contributor
Siemens Valued Contributor

A Creo specific workaround:

In the Creo format, add the Creo internal system parameter for drawings    &todays_date     then when creating a new drawing, and selecting this format ( or the template that includes this format) the   &todays_date   will populate with the date of creation. This is a static note. This Creo system parameter    &todays_date  format is contorlled using the config.pro setting  todays_date_note_format. 

Betreff: Format a date in BMIDE

Solution Partner Legend Solution Partner Legend
Solution Partner Legend

This is an easy Task with the Teamcenter Add-On 'PLMEasy' from SIEMENS Software - SIEMENS PLMEasy Team in Germany. Current Version TC12.0.1 for customers located in DE, CH or AT Region.

 

1. Ceate a runtime property on your business object in BMIDE. Deploy your template.

2. In PLMEasy configuration define the source date property and the desired date format - e.g. %d.%m.%Y

3. Add this runtime property to your mapping file for Creo.

Michael
Teamcenter UA | NX CAD

Re: Format a date in BMIDE

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor

LorraineDennis, This is a good workarund I did not know about it, but the problem is (I did not mention this in my question) is that we have 3 dates (Creation date, Construction date and Approved date). So approved date is taken from the workflow and because of this this would not work but thank you anyway.

Betreff: Format a date in BMIDE

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor
@Michael_Ruhnke Unforunately I'm not in that region, so I do not have access to PLMEasy.

Betreff: Format a date in BMIDE

Solution Partner Honored Contributor Solution Partner Honored Contributor
Solution Partner Honored Contributor
How about creating compound properties on the Item Revision for "Dwg Creation Date", "Dwg Construction Date", "Dwg Approved Date" then populating them with only the date as a string? I believe a string will map across without issues.

Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11 | SW 2016 | Creo 4 | TcUA 11.4
Evaluating: AW 3.4

Re: Format a date in BMIDE

Siemens Valued Contributor Siemens Valued Contributor
Siemens Valued Contributor

Another very CREO workaround, best explained in an example.

 

Map the TC creation date to a Creo Parameter   e.g. creation_date.

Create another Creo parameter called                 e.g. creation_date_truncated

Write a Creo relation    e.g. creation_date_truncated = extract(creation_date,1,10)

 

This will truncate the parameter value "creation_date" start to count a the 1 position, and stop at 10 digits.

 

creation_date =  2019-02-14 17:04  

creation_date_truncated = 2019-02-14

 

Place the parameter    &creation_date_truncated     on your drawing.

Good luck.

 

 

Re: Format a date in BMIDE

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor
Thanks @LorraineDennis,
This is working if I create dataset in Teamcenter and then open it in Creo. So in this case Teamcenter is using templates from teamcenter which has the part with parameter creation_date_truncated. So lets say this is a good workaround.

Still the problem remains if I create part inside Creo. In this case Creo is using local templates, which do not have creation_date_truncated parameter and also I cannot put it inside prt template because creation_date does not exist yet.

Betreff: Format a date in BMIDE

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor
@RandyEllsworth
Can you please explain how can i populate compound property with only date as a string if for example creation_date is a date property. Maybe it is simple but unfortunately I do not understand the answer. Sorry :-)

Betreff: Format a date in BMIDE

Solution Partner Honored Contributor Solution Partner Honored Contributor
Solution Partner Honored Contributor
You would have to write code to convert the data type from DATE to STRING then truncate the string to populate your compound property. Not for the faint of heart … but possible … and doesn't break anything.

Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11 | SW 2016 | Creo 4 | TcUA 11.4
Evaluating: AW 3.4