Page tree
Skip to end of metadata
Go to start of metadata


You want to use a script during mapping of CAD values from CAD to SAP characteristics.


In applications\<cad>\customize\config\attributes-to-sap.xml you can define a script (convert.js) when mapping a CAD attribute (CAD_PROPERTY1 to a SAP characteristic (SAP_CHAR1).

<DIR_CLS class="AUTOCADCLASS" classtype="017" characteristic="SAP_CHAR1" transfer_empty_value="true">
  <SCRIPT name="convert.js">

In folder <ECTR configuration>\customize\scripts\attributes you create a script-file convert.js.
Here’s an example:

// this script converts the string representing a number in exponential format
// like 3.633432511522E+09 or 3,633432511522E+09 into usual number format 3633432511.522
// input with "e" but which not represents a number in exponential format will produce "NaN" - not a number
// other input values will not be converted

value = ""; // global variable "value" as return value

  value = argv[0] // first assign unconverted value, for the case it is not in exponential form
  // do the right conversion
  if(value.contains("E") || value.contains("e")){
    var neutral = value.replace(",",".") //only needed if your input value uses , as decimal separator instead of .
    value = Number(neutral)

  • No labels