Macro Excel

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)

1 Like

@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...

2 Likes

Surely... It's the dark side of the story

1 Like

That's the thing,
It's that I receive an Excel from the client, but I'd like to avoid retyping everything.

 

This is a source of error. I'll have to go through Solidworks and throw a macro for it to grind and get my list of dxf files in the client's folder.

 

In my case, the Excel file will always be the same, it will always be the length that will change and while we're at it the length of the wings.

 

And by going through Driveworks? I can't get everything back at once?

 

I want to spend 1 day programming, it's something that comes up often, so it will still save me time.

1 Like

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.

Here I have just told my life:)

2 Likes

@Aurelien (from Axemble support) :p

 

I get different excels, but formatting them only takes me 2 minutes.

Sorting an Excel is faster than typing everything in Sw by hand, then exporting everything one by one in dxf =)

I persist!

The Excel file can be opened by your macro in SW at the idea of a dialog window in which you indicate the way.

Then your code retrieves the info. and closes the Excel file and then processes according to the desired month.

This does not prevent you from having the family of parts to create the configs.

@ Coin37coin: We can also imagine another window to indicate the path in which to save the dxf.

One day won't be enough...

2 Likes

@Bart: I understand that the most tedious thing is to retype everything, that's why I offered you solutions to use an Excel table in SolidWorks :

http://help.solidworks.com/2013/french/SolidWorks/sldworks/t_Inserting_an_External_File_as_a_Design_Table.htm

https://www.youtube.com/watch?v=8SW-UZy1QMA

https://www.youtube.com/watch?v=rSeYL77cqBQ

With that, it's going to take you a little longer than the current formatting, and then you use the macro to export all the configurations to DXF here:

https://forum.solidworks.com/thread/27842

Edit:

After that, it's quite possible to automate it totally, but even with my level in VBA, I won't get into it, unless you have to do it 20 times a day...

1 Like

What about the MyCadTools PilotAssembly utility? It manages all the dimensions in an Excel file, you just have to copy and paste your different variations!

And with Batchconverter to manage DXF exports:)

Anyway, since you don't have THE Axemble support medal, I think this information is useless:P 

1 Like

So you are already doing some formatting right now?

So why not do the shaping in order to stick in a family of parts?

It's quite possible, and it's really very simple!

You need to create a part family template file that you will save under a new name, and in the part family, paste your table formatted especially for the part family.

Abracadabra, you have all your configurations!

Then just use the macro I suggested above.

3 Likes

Thank you all, I'm going to talk about it all in peace when I get back.

 

I have analyzed your different answers, there is surely the right solution in the heap:p

 

Lucas, these are things that I really do often, I have already automated machine programming and sheet metal flows. I only have the Sw part left.

 

I'm going to do several tests with all your tips and I'll get back to you!

 

With maybe a nice tutorial =)

 

Edit: Well yes Lucas! That's what I was going to do. A simple copy paste suits me perfectly! =) Do you see when you want:p hehe

3 Likes

For me it was obvious, so I had assumed that you wanted something more advanced!

1 Like

I had the same need as you, I made myself a macro (for all my needs for laser cutting).

I am attaching it to you. 

All you have to do is:

  • extract the files
  • Create a room with a room family
  • Launch the macro
  • to check "Standard conf" or "marking any conf" 
  • and click on "go"

The macro will create a DXF unfolder by config with their names...

I'm a novice in macro if there are improvements to it, I'm interested^^


export.rar
5 Likes

@remrem, when you say that you have made an application, that is?

 

Have you created an app in C++? or something like that?!

 

Thank you damoon, I'll test it tonight! =)

@Dammon, can you post the macro code in SWP in a text file please?

It's exactly what I said above, with a link to a macro available here:

https://forum.solidworks.com/thread/27842

1 Like

The macro contains several modules with a user from.. I can't send them in txt... unless there is a solution...

It should open in SolidWorks 2015. 

2 Likes

@Bart:

Yes, this is an Add-in for Excel developed in VB.net.

I had mentioned the subject here: http://www.lynkoa.com/forum/solidworks/creation-de-nomenclature-d-assemblage-solidworks-api-document-manager

2 Likes

@Damoon: You can create a tutorial here: 

http://www.lynkoa.com/tutorial/create

It could be interesting because your macro looks complete, and you can put explanations.

3 Likes

Tuto fait ^^ good test!!  

http://www.lynkoa.com/tutos/3d/macro-d-export-deplie-de-piece-en-dxf

2 Likes

Okay, I'll come back to the charge! :p

 

After an analysis of all your answers, I finally opted for the family of parts with macro proposed by Lucas.

 

So I took a piece with a lot of options and I filled in my excel.

The macro works great!

 

On the other hand, the macro gives me my dxf folded and unfolded, then I would like to add a triple reconstruction between each dxf export.

 

Other than that, it's great:p

 

And Damoon, I'm testing your macro tomorrow ;), thanks for the tutorial!

 

You could add a little video that shows an action =)

2 Likes