4 Replies Latest reply on Nov 7, 2018 12:14 PM by Tom Coulter

    Solidworks sheetmetal bend table switching

    Chris Ward

      Hi guys and gals,

      I have a question for macro experts out there.


      At my workplace we sell kit set plans for manufacturers to fabricate around New Zealand. Almost everything we do is in plate steel so we use sheetmetal for everything.


      The same design may be profile cut at a number of different profile cutting shops, all using different tooling to do the pressing.


      In the past we have used a global k factor for our sheetmetal of 0.4 and had few problems come back to us but occasionally parts may need to be recut at a cost to our customer or ourselves. It has also wasted a lot of time talking to press operators on the phones. We want to take all the guess work that goes on to ensure our parts are up to our design specs.


      We have obtained bend table information from cutters we use and would like to integrate it into our existing sheetmetal parts using a macro.


      We have 2 issues

      1. We now use a bend table on all our new parts,  but we would like to change all of our legacy parts to bend table driven bend allowances. To stop any errors propagating due to using pack and go.


      2. Once we have an assembly of 'updated' parts we would like a quick way to change the bend table to suit a different manufacturer on all parts and then save the assembly.

      Often our assemblies have over 100 parts.


      We mostly work on a jobbing projects and the shear number of models makes it impractical to have 'master' assemblies that have been manually updated.


      On 99% of our parts we use the insert bend feature not a base flange as this method is far more robust for using driving sketches. I'm not sure if this would be an issue or not.


      I have searched around and there isn't a lot of information on this topic so all ideas are welcome.  



      Ryan Ward

        • Re: Solidworks sheetmetal bend table switching
          Keith Rice

          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.



          SolidWorks API Training and Services

          • Re: Solidworks sheetmetal bend table switching
            Chris Ward

            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
            1. Open solid works
            2. Load each part document from folder and sub folders individually
            3. Check for sheetmetal feature,  if none close part without saving
            4. If sheetmetal is present delete the existing bend table (if any), which should then revert to k factor?
            5. Add a new bend table selected in the dialog box above
            6. Rebuild part
            7. Save and close
            8. ext part
            9. 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.