Cancel
Showing results for 
Search instead for 
Did you mean: 

Rename datasets with PLMXML export

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Hello,

 

it is possible to rename dataset with PLMXML Export (before, while or after the export) in other names with custom Attributes?

 

the default PLMXML Export (ConfiguredDataFilesExportDefault) exports the datasets with the named reference name.

i have custom attributes like project_ids. and what i want ist to export .prt and jt Files with names like

%project_ids%-%CustomAttribute%-%itemID%

does anyone have an idea how to do that?

 

thank you

9 REPLIES

Re: Rename datasets with PLMXML export

Phenom
Phenom

Can you give me an example of what you want to acheive with screenshots if possible so I can better understand what you are trying to acheive.

 

Its certainly possible to export your custom properties (depending on there type) to a an xml file.  Then, you will have to edit the export manually or with a script to edit the name and then re-import it.

 

Or, you can write an XSLT file to transform the xml file by swapping properties or building a property value by concatanating other properties and values.

 

Rich

Richard Bennett
PLM Consultant
www.ProspectPLM.co.uk

Re: Rename datasets with PLMXML export

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Hallo Richard,

 

sorry for the late answer.

 

i have a workflow 0 PLMXML which exports the dataset (.prt file) with the attribute project_ids in the xml file (in my case it's a export_from_TC.plmxml file). and that works.

what i want to do is to rename the exportet PRT's from %ItemID%_%RevID%.prt to %project_ids%_%ItemID%_%RevID%.prt

how can i do that?

thanks

Re: Rename datasets with PLMXML export

Solution Partner Honored Contributor Solution Partner Honored Contributor
Solution Partner Honored Contributor
Renaming NX files outside of NX is a bad idea as any internal references (assemblies, wave, etc.) will be broken (yes, an NX part is basically a database - see ug_inspect). That's why NX Clone is used to export/import into Teamcenter. You might be able to accomplish this with PLMXML but I wouldn't recommend it. Any renaming on NX files should be done within NX (or NX tools/utilities). Please rethink your approach/requirement.

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

Re: Rename datasets with PLMXML export

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Hello Randy,

 

the format of the exported Dataset was just an example. 

i want just to know how renaming Dataset with plmxml after or while exporting.

i want to do it for other Dataset format (.jt and .stp).

 

Re: Rename datasets with PLMXML export

Phenom
Phenom

I'm a bit lost now... Why are you renaming the files? Are you renaming the dataset and/or the named reference and are you then reimporting?

 

To rename in the PLMXML I would just use a .bat file which did a find a replace.  There is no doubt better solution with VB, perl etc, but I cant program in those languages!

 

And, if you are re-importing after the edit, then I would just do a small sample and do it manually first to make sure it worked.

 

Rich

Richard Bennett
PLM Consultant
www.ProspectPLM.co.uk

Re: Rename datasets with PLMXML export

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

we have a release workflow which creates (with Dispatcher) the .jt and .stp files in the released ItemRevisions.

we want to export these .jt and .stp files with plmxml to filesystem. That works fine, but we want than to rename the exportet files in filesystem with the custom attribute from the ItemRevision.

 

 


@ProspectPLM wrote:

To rename in the PLMXML I would just use a .bat file which did a find a replace.  There is no doubt better solution with VB, perl etc, but I cant program in those languages!

 

 

Rich


how should the .bat looks like?

 


@ProspectPLM wrote:

 

 

And, if you are re-importing after the edit, then I would just do a small sample and do it manually first to make sure it worked.

 

Rich


actually we dont reimport the exportet files. but that's a interesting point when we use a Dispatcher Service for the plmxml export. can you give more information about that?

Re: Rename datasets with PLMXML export

Phenom
Phenom

There are dedicated forums for using commands and scripts to maniuplate files rather than this forum.  Google is your friend.  A quick search for "cmd find and replace in text file" returns several results including:

https://stackoverflow.com/questions/60034/how-can-you-find-and-replace-text-in-a-file-using-the-wind...

the recomendation here is to use Powershell rather than cmd as its more powerful:

powershell -Command "(gc myFile.txt) -replace 'foo', 'bar' | Out-File myFile.txt"

 Your next question:


actually we dont reimport the exportet files. but that's a interesting point when we use a Dispatcher Service for the plmxml export. can you give more information about that?


I dont understand!

Richard Bennett
PLM Consultant
www.ProspectPLM.co.uk

Re: Rename datasets with PLMXML export

Solution Partner Creator Solution Partner Creator
Solution Partner Creator

Thank you for your help.

 

@ProspectPLM wrote:

 

 Your next question:

actually we dont reimport the exportet files. but that's a interesting point when we use a Dispatcher Service for the plmxml export. can you give more information about that?

I dont understand!

there is a Dispatcher Translator ...Module\Translators\plmxml_import_export. if i could export the project_ids attribute with this translator, so i can rename the exportet .jt and .stp with a rename.bat.

 

so now i'm trying to configure the plmxml_import_export Translator correctly, but it does'nt work.

what i did:

 

 

- create TSplmxmlexportService.properties with the following content Translator.SIEMENS.plmxml_import_export.Prepare=com.teamcenter.ets.translator.ugs.basic.TaskPrep

 

- add TSplmxmlexportService to Service.properties

 

- edit translator.xml. it looks like:

<?xml version="1.0" ?>

<!DOCTYPE Translators[
<!ENTITY MODULEBASE "C:/ugs/TC11/Dispatcher/Module">
<!ENTITY JAVABIN "C:\PROGRA~1\Java\JRE18~1.0_7\bin">
<!ENTITY IDEAS "C:/UGS/IDEAS12">
<!ENTITY ORBIX "C:/ORBIX/Iona/asp/6.1/lib/">
<!ENTITY PROJTRANS "d:/ProjTrans">
<!ENTITY PT_JFV "_10000.1.0">
<!ENTITY UGSPKG "com.teamcenter.translator.ugs.">
<!ENTITY WRAPPER "com.teamcenter.tstk.server.translator.ugs.">
<!ENTITY EAIWRAPPER "&WRAPPER;EaiTranslator">
]>

<Translators>

<!-- ************************************************************************************ -->
<!-- Translation Service plmxml translator Generation Services -->
<!-- ************************************************************************************ -->
<PlmXmlImportExport provider="SIEMENS" service="plmxml_import_export" isactive="true">
<TransExecutable dir="&MODULEBASE;/Translators/plmxml_import_export" name="plmxml_import_export.bat"/>
<Options>
<Option name="clientoption" optionkey="dcproxy" string="-u=" value=""
description="Specifies user name to login to Teamcenter."/>
<Option name="clientoption" optionkey="dcproxy" string="-p=" value=""
description="Specifies password to login to Teamcenter."/>
<Option name="clientoption" optionkey="dba" string="-g=" value=""
description="Specifies group to login to Teamcenter."/>
<Option name="clientoption" optionkey="encrypted_password" string="-encrypt=" value="true"
description="Specifies whether or not password is encrypted to login to Teamcenter."/>
<Option name="clientoption" optionkey="export" string="-mode=" value=""
description="Mode of operation Import or Export"/>
<Option name="inputpath" string=""
description="Full path to the input file."/>
<Option name="outputdir" string=""
description="Full path to the output directory."/>
<Option name="clientoption" optionkey="file" string="" value=""
description="Specifies output filename."/>
<Option name="clientoption" optionkey="logfilename" string="" value=""
description="Specifies log filename."/>
</Options>
<FileExtensions>
<InputExtensions nitem="1">
<InputExtension extension=".xml"/>
</InputExtensions>
<OutputExtensions nitem="1">
<OutputExtension extension=".log"/>
</OutputExtensions>
</FileExtensions>
</PlmXmlImportExport>

 

- edit the ...Module\Translators\plmxml_import_export\plmxml_import_export.bat 

 

when i select a itemrevision and try to translate it. there no Translator definitions avaible.

what preference i need to add?

and how can i start this translator as a workflow?

 

 

Re: Rename datasets with PLMXML export

Phenom
Phenom

I would start a new topic for this as this topic has now evolved into - How to setup PLMXML translation service in Dispatcher.

 

And without doing this myself I dont know :-) Its something I havent done before.

Richard Bennett
PLM Consultant
www.ProspectPLM.co.uk