-
Notifications
You must be signed in to change notification settings - Fork 53
Bill of materials
Mark Moissette edited this page Mar 31, 2013
·
6 revisions
[[TOC]]
- Any part subclassing the built-in Part class will get registered in the system at compile time, and any parameters passed to its options hash will also get recorded
ie:
class CoolHardware extends Part
constructor:(options)->
defaults = {thickness:5}
#here we merge defaults and the options passed in using the
#"merge" utility function :it takes two objects/hashes,
#and merges them into one
{@thickness} = options = merge(defaults, options)
#we pass the full options hash (parameters passed in + defaults)
#to the parent class
super options
@cb = new Cube({size:[5,10,@thickness]})
@union(@cb)
- after you compile a project, you can go to file -> export -> bom , and review the list of parts in your project and then export that list as a json file
- any custom change to the quantities, variant name, manufactured boolean etc are reset every time you re-compile your design, but if you change the settings and export them , the correct quantities etc will be present in the json file
** Note:** you can find this specific example at the project->examples->object oriented->defining parts