Macro Excel

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

@Bart:

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

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

You want to have your cake and eat it too! :-p

Are you sure that the triple reconstruction is necessary?

 

When I talk about video, it's for the tutorial:p it's just more attractive and prettier that's all =)

 

Then for the triple reconstruction, yes it is necessary, otherwise I won't be.... with that:p

 

I don't think I'm the last one to help. Send me the buyer back! ^^

1 Like

Here is the macro I got  from Lucas' link:

 

Option Explicit

Sub main()

    Dim swApp                   As SldWorks.SldWorks
    Dim swModel                 As SldWorks.ModelDoc2
    Dim vConfNameArr            as Variant
    Dim sConfigName             As String
    Dim nStart                  As Single
    Sun i                       As Long
    Dim bShowConfig             As Boolean
    Dim bRebuild                As Boolean
    Dim bRet                    As Boolean
  

    Set swApp = CreateObject("SldWorks.Application")
    Set swModel = swApp.ActiveDoc

    vConfNameArr = swModel.GetConfigurationNames

    For i = 0 To UBound(vConfNameArr)

        sConfigName = vConfNameArr(i)

       
bShowConfig = swModel.ShowConfiguration2(sConfigName)

bRebuild = swModel.ForceRebuild3(False)

Dim FilePath As String
Dim PathSize As Long
Dim PathNoExtension As String
Dim NewFilePath As String

FilePath = swModel.GetPathName
PathSize = Strings.Len(FilePath)
PathNoExtension = Strings.Left(FilePath, PathSize - 6)

NewFilePath = PathNoExtension + sConfigName & ". DXF"

Export Flat Pattern
bRet = swModel.ExportFlatPatternView(NewFilePath, 1)

Next i

End Sub

So where are you at? What do you need help with?

Hello

I take the liberty of bringing up this subject which interests me greatly 

First of all, I thank the people of this topic who took the time to answer this problem.

Luca's macro is great for a dxf export of unfolded parts of a family of parts, thanks to him :-)

Do you think that this macro can be updated with folded lines in the unfolded in the export?

Thank you for your feedback.

 

Hello qlamy,

Look here.

Kind regards

2 Likes