cancel
Showing results for 
Search instead for 
Did you mean: 

Map an original filename as the DIR number in Import without using file properties.

nadiener
Explorer
0 Kudos
1,636

I want to derive the filename and map to the document number field in the import dialog without the requirement of creating, mapping and entering a custom file property? Is there an attribute that is usable by the import that maps the original filename?

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

As of version 5.1.13.0 ECTR provides three new attributes:

  • _FILENAME
  • _FILENAME_WITHOUT_EXTENSION
  • _FILE_EXTENSION

... if they were not already provided by specific CAD Integration.

s. Enhance attributes mapping during create/save (PLM-23207, IR 200286)

GerhardHimmelsb
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Neal,

I'm not sure, if I completely got your question. I'm also assuming you are talking about SAP ECTR.

Do you want to:

  1. use the filename as DIR number (external numbering)
  2. rename the file to the new DIR number (e.g. file box.prt gets renamed to 12345678.prt
  3. map the filename into an attribute in the DIR

Is your goal to preserve the filename?

Maybe you can also add a screenshot.

Thanks,

Gerhard

nadiener
Explorer
0 Kudos

I recently found the article for preset values to the import on demand dialog: https://wiki.scn.sap.com/wiki/display/PLM/How+to+preset+values+during+document+creation+process+via+....

I am using SAP ECTR with SolidWorks Integration. Can I set an attribute to read the filename without using a custom property definition in SolidWorks.

For instance, out of the box the import on demand dialog uses the filename for the description without having to define a custom property in the native file. Is that attribute available for use in the attributes-to-sap definition.

I have built my current attribute-to-sap with the line that retrieves the DIR Number "_DOCNUMBER" for the import from the file property "NUMBER". In the file properties in Solidworks I have set the value of the NUMBER property to $PRP:"SW-File Name". How can I replace the APPL_ATTRIBUTE name="NUMBER" with a value to give just the filename without having the custom property defined.

<APPL_ATTRIBUTE name="_DOCNUMBER">                                               
<APPL_ATTRIBUTE name="NUMBER"/>                               
</APPL_ATTRIBUTE>                               
nadiener
Explorer
0 Kudos

In ECTR, when using the import tool in the Solidworks application the filename is automatically mapped to the description field in the import dialog. I want to map it to the Document Number field instead. I do not want to have to rely upon an application attribute.

Can I map this in the Attributes-to-SAP.xml ?

<APPL_ATTRIBUTE name="_DOCNUMBER">                                               
???  <what tag and = "name/> ??? application filename without extension                             
</APPL_ATTRIBUTE>
GerhardHimmelsb
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Neal,

please try:

In attributes-to-sap.xml

<section name="EXAMPLE" include_section="" description="create only">

<APPL_ATRIBUTE name=”DOCNUMBER”>

<APPL_ATRIBUTE name=”NAME_OF_THE_ATTRIBUTE_WITH_FILENAME”/>

</APPL_ATTRIBUTE>

</section>

Then change in the corresponding dtype.xml

<document_create ... attribute_section=”EXAMPLE” ...>

Hope this helps.

Regards,

Gerhard

0 Kudos
Hello Neal,

small correction:

<section name="EXAMPLE" include_section="" description="create only"><br>  <APPL_ATTRIBUTE name="_DOCNUMBER"><br>    <APPL_ATTRIBUTE name="NAME_OF_THE_ATTRIBUTE_WITH_FILENAME"/><br>  </APPL_ATTRIBUTE><br></section>

(the underscore is important)

ECTR itself doesn't provide extra attributes, the CAD Integration has to provide some attribute with the value of the filename.
You have to ask the provider of the CAD Integration if there is a such attribute and what it's name is.

With kind Regards,
  Waldemar 
nadiener
Explorer
0 Kudos

Thank you for your answers. I was hoping there was some method to capture the filename without the use of a custom property. I wanted to avoid the overhead of having to create a property in legacy files that have been stored offline. I will contact the vendor and share any positive developments.

Information for others that may read this thread...

In my case, I use the following xml to capture the value in the NUMBER property in Solidworks. The value is case sensitive and we have many groups working together an so I have included multiple values and use the first non empty value for the mapping.

In Solidworks itself, the property is written as $PRP:"SW-File Name" this is an environmental variable the evaluates as the filename.

For groups of multiple files, I use the SolidWorks Task Scheduler>Custom Properties Update utility to apply the $PRP:"SW-File Name" value to all files in a folder.

<section name="SLWMDE" description="Model mapping from SOLIDWORKS 3D to SAP">   
		<APPL_ATTRIBUTE name="_DOCNUMBER">
			<FIRSTNONEMPTY>
				<APPL_ATTRIBUTE name="NUMBER"/>
				<APPL_ATTRIBUTE name="Number"/>
				<APPL_ATTRIBUTE name="number"/>
			</FIRSTNONEMPTY>
		</APPL_ATTRIBUTE>