powered by CADENAS

Manual

Manual

16.2.6.1. Example 1

Via functions, external files can be referenced to as well. This occurs with vbs files.

[Note] Note

A special license is required here (PSAPI), unless the file is coded as a .vbb file. (CNS2009*PSAPI*LANG*VBS)

A simple use-case would be for example if for DIN 912 the CAD file name is to be created differently than from the other DIN standards and different again for all other projects.

  • The following script is entered in the PARTlinkManager under "Extras > Configure ERP environment > standard naming or standard description (short): NB =SCRIPT(' nb . ruletable ','$CALCED_ROW.','$NB.')

SHORTNB =SCRIPT('nb.ruletable','$CALCED_ROW.','$SHORTNB.')

  • The file "nb .vbs" must be located under "...setup/scripts/common".

function ruletable (table,calced_row,orgNB)

result=""

mmrow=cint(calced_row)

if mmrow >= 0 then

tmp=table.NN

normbezeichnung=table.rows.item(mmrow).resolvevariables("$NB.",0)

'1.

if tmp="DIN 912" then

result="ISO4762"+"_"+table.rows.item(mmrow).resolvevariables("$NENN.$MATERIAL.",0)

'Variables NENN and MATERIAL receive ISO4762 as prefix.

end if

'2.

pos=Instr(1,normbezeichnung,"DIN")

if pos >= 1 then

result=tmp+table.rows.item(mmrow).resolvevariables("$NENN.$MATERIAL.",0)

'All other DIN standards are made up of NN, NENN and MATERIAL.

end if

if result="" then

result=orgNB

‘ All other projects are created with NB.

end if

end if

ruletable=result

end function

Extensive programming may be excluded in this way.