8 Replies Latest reply on Aug 6, 2017 6:13 AM by Peter Brinkhuis

    Complex Automated Assembly Program Workflow Ideas

    Vincent Porter

      I am new to the forum, Solid Works and the Solid Works API.  I have worked with C++, VBA and Excel VBA.  I need some advice on a few different ways to program an assembly.

       

      Problem:  I have an assembly that takes several hours to mate.  The assembly consists of standards parts and fasteners.  One assembly could be up to a few hundred standards parts and several hundred fasteners.  But, the assembly is mated in a logical pattern with the parts and fasteners.  This is a very tedious process.  One issue is that if the engineer making the assembly doesn't follow the same pattern when I export the assembly and import it into another program (MATLAB) the import is disorganized and difficult to manipulate. 

       

      Example:  Assumed mate Part A to Part B, but engineer mates Part B to Part A...  All the export variables will change sign and because of the large number of mates the probability of mating order error is large.  Even if the error percent was 0.1% per mate after mating 100 parts the error probability would be 9.5%.  That is roughly 1 in 10 exports will have inverted signs.  And finding the errors is very difficult and time consuming.

       

      Workflow Ideas

      1. I am not set in stone on using a program.  If I can accomplish the tasks in a logical repetitive order while assembling the parts and fasteners and in a timely fashion I would not spend the time to write a program
      2. Engineer loads all the necessity assembly parts to the assembly model.  Created a user form where the engineer selects and stores the components, faces, and edges to be mated.  Then the program mates the parts to the fixed part in the assembly and then copies the components for the next iteration of mating and references the new components, faces and edges based on the engineer's original selection.  This program would loop thru the assembly iterations until the desired assembly is created.
        1. Created User Forum and can access it thru running a macro.  Would be nice to attach it to a button and put it into an add-in to be distributed to the engineers.
        2. Worked out prompting engineer to select the mate face/edge.  Need some information on how to effectively store the component, the body, the entity from the selected face/edge.  Might need to change the edge property so I can find the face/edge again after storing and copying.
        3. Need information to how to copy the components and select for mating
          1. I have the old component stored so creating a new one shouldn't be an issue (Assuming, Need to find an example)
          2. I have the old component face/edge stored I hope I can compare the old face/edge to the new faces/edges and find the same face/edge on the new component
          3. I need some help navigating thru the different objects of a components.
            1. Component to Body to Face/Edge to Entity and Select for mate.

       

      Any ideas and help would be greatly appreciated

       

      Thanks

        • Re: Complex Automated Assembly Program Workflow Ideas
          Amen Allah Jlili
          Assumed mate Part A to Part B, but engineer mates Part B to Part A...  All the export variables will change sign and because of the large number of mates the probability of mating order error is large.  Even if the error percent was 0.1% per mate after mating 100 parts the error probability would be 9.5%.  That is roughly 1 in 10 exports will have inverted signs.  And finding the errors is very difficult and time consuming.

          If you know Part B is mated to Part A, can't you inverse the sign in your data or you don't have a way of knowing that?

           

          The question is not really clear. Can you break it down into simpler independant issues?

            • Re: Complex Automated Assembly Program Workflow Ideas
              Vincent Porter

              If Part B is mated to Part A the export inverts the sign in MATLAB.  I can't find the inverted signs until I run the solver and the outputs don't make sense.  Plus the difference in values are +0.1 DEG or -.1DEG.  Then I have to figure out what mate was inverted and this takes a lot of time then I have to manual change the signs on all variables in the program.  There are several hundred variables I have to sort thru.  The other issue is I don't have a way to identify the inverted mate until I review the charts and there are usually 100 charts and because the going from +0.1 DEG to -0.1 DEG is such a small change I can't guarantee I will find 100% of the inverted signs.  The +/-0.1 is just an example.  In some assemblies the -0.1 would be correct and that makes it difficult because in MATLAB I could just find all the negative variables and just change the sign.

               

              Problem #1

              Need a rapid and consistent way to mate an assembly.  Rapid for Time - would save a lot of Engineering Time.  Consistent for the export sign issue.

               

              Problem #2

              Solve Problem #1 with Solidwork built in features or Program my own

               

              Problem #3 (Program my own)

              Solidworks API has a lot of different object types.  If I have a Component Object how can I traverse to the Body Object, the Face Object, the Edge Object, the Entity Object associated with the Component Object and vice verse.  I don't understand what is Parent/Child or if they are even related to each other.

               

              Thanks for the response.  You got me thinking about just flipping all the negative signs to positive in the export.

            • Re: Complex Automated Assembly Program Workflow Ideas
              John Alexander

              With this tool that you want to build in Problem #2, how will you determine when a part has the wrong mate order in Solidworks? If the user selects two faces which then populate a user form, how will your macro determine which component should come first?

               

              It isn't clear what the Matlab program does with the SW Assembly so it isn't clear what motive there is to swap the mate order.

               

              It seems like you could skip Problem 1 and 2 by improving the Matlab script so that it is considers the mate order.

                • Re: Complex Automated Assembly Program Workflow Ideas
                  Vincent Porter

                  They could select Part B then Part A incorrectly when it should be Part A then Part B, but the User Form is labelled so if they follow the instructions they with select Part A then Part B.  The program has to be taught what is Part A and Part B from the user so they could teach it wrong, but after some training I think it would reduce the probability of error and increase the rate they could make assemblies.

                   

                  In looking at some of the assembly exports from Solidworks that where mated Part B then Part A I do think I could find them in the generated XML file.  So Problem #1 the Consistent part I think I could correct right now, but I just wanted to build them something to same them some time.  2 Birds 1 Stone.

                   

                  Thanks John.  I will let you know if I can get it worked out.

                    • Re: Complex Automated Assembly Program Workflow Ideas
                      John Alexander

                      But what is the rule for which precedes the other A->B or B->A? Are you just saying that it needs to be consistent?

                       

                      If there were only two components in an assembly and only one mate between them, what would be the correct order for mating them according to the Matlab program?

                       

                      Have you considered that some assembly mates require several component selections? I ran into this problem when writing a macro that would export a graph of the mates in an assembly. In the end, I just decided to ignore things like "Width" mates and basically only use coincidence, concentric, etc. to populate the graph edges.

                  • Re: Complex Automated Assembly Program Workflow Ideas
                    Peter Brinkhuis

                    Can you show us an example of an assembly that you're working on? I have no clue what this is about and it seems that Amen and John are having trouble as well. What are you exporting to Matlab and what are you doing with it there?

                     

                    If your engineers are making many similar assemblies, I suggest you use something like the product configurators from Tacton or DriveWorks. Or maybe even using a pattern to avoid having to manually mate hundreds of fasteners. Very often a linear or circular pattern will do, for the rest there is the Pattern Driven Component Pattern, a real life saver.