- I have a sheet metal profile that I need to export in dxf (unfolded sound)
- This profile varies in length
- I have the list of all lengths in an Excel workbook as well as their respective quantity.
Is it possible via the excel file, to export all the dxf according to the lengths, automatically.
A little extra point, between each change of lengths, we must have a triple reconstruction because there are formulas to recalculate according to the length.
And also, if possible, have in the name of the dxf, the quantity relating to such and such lengths.
Do you have to go through a family of rooms? By a macro? Or something else?
I'm going to repeat myself but your play has a family of plays or not?
Then how do you know which configs to taritate: what does your Excel file contain the name of the config, the length? Is there a relationship between the length and the name of the config?
Here's an example of a macro that lists the configurations of a file: http://help.solidworks.com/2015/english/api/sldworksapi/Get_List_Of_Configurations_Example_VB.htm
Then you will have to compare the list obtained with the one in your Excel file.
Then export to dxf: http://help.solidworks.com/2015/english/api/sldworksapi/solidworks.interop.sldworks~solidworks.interop.sldworks.ipartdoc~exportflatpatternview.html
At first glance, it doesn't seem impossible to me. I don't know the gateway to go from excel to part opening in solidworks ... But I don't see why it couldn't be done.
To forgive, then. When you've solved @Bart, if you could give us the outline of your code. It could help in the future;)
But I want to know if you can adapt your room to make the macro easier to achieve or if the macro should completely adapt to your environment.
Personally, from experience to achieve this kind of thing and that it works perfectly. It takes quite a bit of time. That's why it's necessary to put things right and to determine our goal clearly. Because otherwise you find yourself coding and then starting all over again because it doesn't suit anymore.
Without mastery of the VBA. I advise you to break down your project according to it and carry them out one after the other. Ex: Opening the file, list of configs, export. And to ask, try and then ask questions on the forum.
For me, I can't carry out this project completely. The goal is also to learn, because if you are given all your codes you will be unable to make them live in time.
I think it will be easier to create your part family from your Excel file before (link below): it will take you 1 or 2 minutes, while the program can be difficult to make and will be a source of errors.
Just like PL, I think the part family would be a good thing. And above all, it would allow you to keep the maximum amount of information and functions in your SW files. That is to say that if your code no longer works or a user does not have access to it, a large part of the information is accessible in SW.
The cool thing about making a macro program is that it can copy its native file into the client's specific folder, open its excel and control everything.
Whereas with the family of parts, he will be forced to create a new one for each customer (if I understood how it works)
@coin37coin yes but spending 1 day programming (maybe less for an experienced VBA user, but I don't think that's the case for Bart) retrieving odds in an Excel file, is it worth it? And assuming that the Excel file still has exactly the same formatting, otherwise it crashes!
If the creation of the part family takes a maximum of 5 minutes (and I think it's less than 5 minutes) to do in SolidWorks by hand, then you would have to do at least 80 minutes for it to be profitable on a 7-hour day...
Well I'm arriving a bit like that, without having read the whole conversation, so mea culpa if it's already been discussed but:
When you receive the Excel file from the client, it is always formatted in the same way?
For us, we proceed with a "construction sheet", it is an excel file where the technical sales representatives enter all the sizing information but also other information for other departments of the company.
Then the B.E uses a sheet called the "Recap'", it is a sheet with a macro that opens this construction sheet, which copies the essential information for the design office and pastes it in certain boxes. It is this sheet that is related to our CAD.