As part of a project, I am required to automate as much as possible the assembly of our products in Solidworks.
The idea is to start from our Excel file which contains the name and path of the components to be assembled.
I created a first macro that extracts these 2 columns to add them to a blank Excel file (which I use as a "software" for users of the program)
Once this information is added, a click opens Solidworks and adds each of the parts in the list to a new assembly file.
So far so good!
Wishing to optimize the assembly as I explained, I added constraint references to each of the components so that they "recognize" each other and assemble in the desired way. However, when I run my program, the pieces are simply open on top of each other... I tried to do the manipulation manually by recording the macro, but in the file obtained, I have the impression that the click on "smartmates" or the "alt"+dragged, are not recognized.
Do you have any idea what code I could use to do this?
If I understand correctly, this program does not use smartmates but it consists of defining for each part different coordinate systems at the places of connections and then it makes these systems coincide with each other to make the assembly. Is that right?