Scripting Examples


#1

Trying to get into the upverter scripting, is there a repository of examples? I found the scripting reference a bit jarring without some examples.


#2

I’m working on better docs for scripting but in the meantime heres one I wrote today to list out all the DNP parts in a design.

print(‘Checking for DNP parts’);
print(’-------------------------’);
api.components.forEach(function(component) {
var dnp = component.attributes[’_dnp’] || ‘?’;
if (dnp == ‘yes’) {
print(component.refDes + ': ’ + component.manufacturer + ’ ’ + component.partNumber);
}
});


#3

Thanks zak! That example is helpful to start.

In the meantime I suppose I’ll look over the scripting documentation more :slight_smile:


#4

Can you share where you found this documentation?


#5

https://upverter.com/apidocs/