Valor NPI : Attribute from Properties script

Document created by stephen_potter on Feb 24, 2012Last modified by stephen_potter on Mar 2, 2012
Version 4Show Document
  • View in full screen mode

This is a simple script that will convert CAD Properties to ODB++ Attributes.

 

 

The script should be placed in the path %VALOR_DIR%\sys\scripts.

 

 

It can be executed by doing the following, after starting Valor NPI:

  1) Open the ODB++ database and the Step that is to be modified.

  2) Access File->Script->Run from the Graphic Station main menu.

  3) Navigate to the script (named "comp_atr_from_prop.txt" unless changed by the user), as shown below.

  4) You may then press Ok or Apply to execute the script.

 

script_run.JPG

 

 

 

The script contents is as follows:

 

# The component side to act on: top, bottom, both
set CSIDE =  both

 

# The component type or package type attribute to
# setany existing component attribute.
# Any other existing attribute could be used here.
set SATTR = .comp_type2
#set SATTR = .package_type

 

# The cad property to extract the value from.
# Any property carried over from the cad design data
# can be used here.
set CPROP = USER_SET_AS_DESIRED

 

# The index of the property if it is an array or
# 0 for a text property. Index starts at 1 if an array.
set CPROPIDX = 0

 

# The numeric mode of the value if not text: inch, mm, mil, micron
set CPROPUNITS = inch

 

# Overwrite any existing attribute values: yes, no
set OVERWRITE = yes

 

# Attribute only selected components: yes, no
set SELECTED = no

 

COM comp_atr_from_prop,side=${CSIDE},attribute=${SATTR},property=${CPROP},prop_index=${CPROPIDX},prop_units=${CPROPUNITS},overwrite=${OVERWRITE},selected=${SELECTED}

 

NOTE: There is also an alternative version of the script, named "comp_atr_from_prop_array.txt", which stores the parameter

settings in an array that is much easier to propagate if you wish to convert more than one property with the same script.

Outcomes