Use Case
You have attributes (properties) in your CAD file which contain the description of your part in different languages. During import-on-demand you want to map those CAD file properties to the language dependent Document Info Record description.
Configuration
The example is shown for Solidworks, but works similar for other CAD systems. Replace SLW by your application.
<?xml version="1.0" encoding="ISO-8859-1"?> <mapping> <section name="my_attrib_section" description="mapping during IoD"> <DIR field="SAP_DESCRIPTION" language="DE" > <APPL_ATTRIBUTE name="SAP_DOCTEXT_DE" /> </DIR> <DIR field="SAP_DESCRIPTION" language="EN" > <APPL_ATTRIBUTE name="SAP_DOCTEXT_EN" /> </DIR> </section> ... </mapping>
If you want to map a specific value also into Import-On-Demand dialog you have an additional mapping, see line 10-12
<?xml version="1.0" encoding="ISO-8859-1"?> <mapping> <section name="my_attrib_section" description="mapping during IoD"> <DIR field="SAP_DESCRIPTION" language="DE" > <APPL_ATTRIBUTE name="SAP_DOCTEXT_DE" /> </DIR> <DIR field="SAP_DESCRIPTION" language="EN" > <APPL_ATTRIBUTE name="SAP_DOCTEXT_EN" /> </DIR> <APPL_ATTRIBUTE name="_DOCDESCR" > <APPL_ATTRIBUTE name="SAP_DOCTEXT_EN" /> </APPL_ATTRIBUTE > </section> ... </mapping>
... and here is the result in the Import-On-Demand UI:
# ----------------------------------------------------------------------------- # If you use an attribute_section for <document_create/> you have to set this option. # Default value is false. # ----------------------------------------------------------------------------- plm.options.importOnDemand.TransferAttributesToSAP.SLW = true # -----------------------------------------------------------------------------
You need to define an "attribute_section" in your dtype definition. The section name "my_attrib_section" refers to the section name defined in attributes-to-sap.xml, see above.
... <document_create ... attribute_section="my_attrib_section" ...> </document_create> ...
Attention: if you have mapping in attributes-from-sap.xml which defines the mapping SAP to CAD, then values are empty. Mapping can also be derived in <ECTR installation>\customize\config\attributes-from-sap.xml via the include_section="default"
<?xml version="1.0" encoding="ISO-8859-1"?> <mapping> <section name="SLWMDL" include_section="default" description="Mapping from SAP to SOLIDWORKS 3D"> ...