I am having problems with finding a way to write an code to fill out my bill of materials in a drawing. I have a nozzle with several different sizes and lengths it is flanged on both ends. Everytime the nozzle changes sizes the part number for the pipe and both flanges changes. I have tried to write a macro for this but I cannot get it to work. I am pretty new at this api stuff so i would appreciate any help with my issue.
SolidworksApi macros
Are you trying to populate the part number column with the configuration specific part number? Do you need to use a program?
I am trying to populate a part number and description. I am trying to stay away from configurations because one of my flanges is pretty well a custom part because my pipe is actually mitered so it has an elliptical cut in it. There are just so many different varations of this part i think trying to do configurations would be a nightmare.
I should also mention that the bill of material i am trying to control is in an assmebly. I dont really know if that matters or not.
so if you're not doing configs, why do you need to programmatically populate the BOM? Solidworks does it for you, in both cases. The only thing you need to do is insert a BOM table, specify the type, and VIOLA! Instant BOM table.
I have a program written that will allow you to pick the size,length, and angle of cut on the nozzle which then the program knows which sizes of flanges that it needs to use. i just dont know how to manipulate the bill so the it will reflect the part numbers and descriptions for the flanges and pipe that size of nozzles uses.
solidworks without macro ,i think, can do it for you, so you should not pay more attention to macro.
good luck!
wen yi