|
Scope:
Web
By:
Applies To: ALL Translators New version of translators support the RadialSoft Naming extension mechanism. This system is made to allow companies to customize the file names produced either to standardize them or to connect the translator to the PDM system. By default a standard naming scheme is used: The standard naming scheme. The default output format string is OutputFormatString = "[%ORIPATH%\\]%ORIFN%.%ORIEXT%[-%POSTFIX%][-%MN%][-%TGTI%].%TGTEXT%" Another good example is Save under a different sub directory SavePath"="G:\\CAD\\SolidWorks\\" "OutputFormatString"="[%OUTDIR%\\]%ORIFN%.%ORIEXT%[-%POSTFIX%][-%MN%][-%TGTI%][.%TGTEXT%]" You can superseed this value by settings the value "OutputFormatString". By default this value is not created. The output format string is used to produce a filename as follow. The original file name is splitted in elements. The recognized items in the format string are replaced by their values. CURDIR Current directory (could be different from original file directory) ORIPATH Directory of original file ORIFN File name of roginal file (without the path and the extension) ORIEXT Extension of original file POSTFIX Extra post fix MN Model name MI Model Index (empty string if 0) RI Reason id. A integer used when several files are produce per model TGTI Target part index (imagine a model containing 10 parts, TGTI will vary from 0 to 9) TGTEXT Target part extension. OUTDIR Predefined output directory. The default output directory is in the registry key "SavePath" (This setting is c:\temp by default) COMPUTER Computer Name USER User Name SOFTWARE Addin Name VERSION Addin Version HOST CAD Software Name HOSTVERSION CAD Software Version ORIROOT Root of path of original Name (like C:\) ORISUBPATH0 File name and lowest directory in the path ( C:\CCC\DFDG\DCC\TE.model will give DCC\TE.model) ORISUBPATH1 Same as above + one level more ( DFDG\DCC\TE.model) ORISUBPATH2 Same as above + one level more ( DFDG\DCC\TE.model) A part of the format string can be surrounded by brackets. Only one level of brackets is supported. If all substitutions made within the brackets are empty the complete text within the brakets is ignored. The Naming Extension If you are limited by the standard naming scheme you can implement and use your own. To achive this you need to use a programming language like C++ or Visual Basic. Add the RSEventsLib type library to your interface and build an object that implements IRSPDMInterface. As of August 2003 the only function is ComposeFileName. Here is the header of this method. HRESULT ComposeFileName ( BSTR OriginalFileName1, BSTR ModelName, int ModelNumber, int ReasonID, int TargetPartNumber, BSTR ExtraPostFix, BSTR DesiredExtension, BSTR CurrentDirectory, BSTR * FullFileName ) { List of Registry settings SubPath/PDMInterface SubPath/OutputFormatString SubPath/SavePath SubPath/Script absolute path to script file (.vbs) Sample Script File
Last modified: May 24th 2005 Once you object is build modify the PDMInterface setting to set it to the ProdID or the CLSID of you own object. Take care that it becomes your responsability to ensure that file names are distinct if you are given distinct model number or TargetPartNumber. |