Is this the correct pseudo-code for the program you would want?
For each component in active assembly Change bend table from X to Y
You would need to use IModelDoc2::DeleteBendTable and IModelDoc2::InsertBendTableOpen. To traverse all components in an assembly, check out the macro called "Run code on every part in assembly" in our Macro Library.
If you need assistance writing this, check out the services we offer by visiting our web site below.
Thanks Keith, I will give this a try and see if it works on all the parts.
I have had no luck with IModelDoc2::DeleteBendTable and IModelDoc2::InsertBendTableOpen
Having a hard time understanding the help.solidworks.com, if anyone has any examples of this code it would help me tremendously.
I can break it down to make it easier to understand.
- Dialog to point to directory and choose bend table from drop down box
- Open solid works
- Load each part document from folder and sub folders individually
- Check for sheetmetal feature, if none close part without saving
- If sheetmetal is present delete the existing bend table (if any), which should then revert to k factor?
- Add a new bend table selected in the dialog box above
- Rebuild part
- Save and close
- ext part
- End if no parts remain
Most of that I am OK with but I am having trouble with the syntax on IModelDoc2::InsertBendTableOpen and IModelDoc2::DeleteBendTable.