Batch Converter - Welded Dude Part - STEP

Hello 

with BATCH CONVERTER is it possible to obtain several STEP files, starting from one mechanically welded part with several bodies?

and also name each step with the name of "List of welded parts" ? 


2-structure_table.sldprt

Hi, I tried the manipulation, obviously it will be necessary to register each of the bodies in the same file beforehand.

Right-click Solid Bodies => Save Bodies.

Then with Batch Converter, you can apply it to the entire folder.

Cdt

PS: you are missing end caps in your construction, very useful to put feet in.

2 Likes

Hello 

thanks for the answer, but actually my goal was to avoid using this "Save Bodies" function.. to save time, when you have a lot of parts to process .

 

PS: yes, it's only a sketch to discuss  

@ monica.danelon

If I understand correctly, do you want to make an assembly from a multi-body piece?

if yes

In the creation tree of your part you right click on the list of welded parts folder then save the bodies.In the Save bodies function you click on Auto Naming assignment, you uncheck Absorb the cut bodies then click on Browse under Reer the assembly in order to name your assembly and finally validate.

From there you have an assembly free to do pack and go to add a prefix to your parts and then save in step.

may the force be with you.

 

Hello. Try this macro:

Option Explicit
Sub main()
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swPart As SldWorks.PartDoc
Dim swBody As SldWorks.Body2
Dim vBodies As Variant
Dim vBody As Variant
Dim boolstatus As Boolean
Dim FilePath As String
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
If swModel Is Nothing Then
    MsgBox "Ouvrir une pièce"
    Exit Sub
End If
If swModel.GetType <> swDocumentTypes_e.swDocPART Then
    MsgBox "Ouvrir une pièce"
    Exit Sub
End If
Set swPart = swModel
vBodies = swPart.GetBodies2(swBodyType_e.swSolidBody, True)
For Each vBody In vBodies
    Set swBody = vBody
    swBody.Select2 False, Nothing
    FilePath = Left(swModel.GetPathName, InStrRev(swModel.GetPathName, ".") - 1) & " - " & GetCutList(swModel, swBody.Name) & ".STEP"
    boolstatus = swPart.SaveToFile3(FilePath, swSaveAsOptions_e.swSaveAsOptions_Silent, swCutListTransferOptions_e.swCutListTransferOptions_CutListProperties, False, Empty, Empty, Empty)
    If swApp.ActiveDoc.GetTitle <> swModel.GetTitle Then
        swApp.CloseDoc swApp.ActiveDoc.GetTitle
    End If
Next
End Sub

Function GetCutList(swModel As SldWorks.ModelDoc2, BodyName As String) As String
    Dim swFeat As SldWorks.Feature
    Dim swBodyFolder As SldWorks.BodyFolder
    Dim swBody As SldWorks.Body2
    Dim vBodies As Variant
    Dim vBody As Variant
    Set swFeat = swModel.FirstFeature
    While Not swFeat Is Nothing
        If swFeat.GetTypeName = "CutListFolder" Then
            Set swBodyFolder = swFeat.GetSpecificFeature
            vBodies = swBodyFolder.GetBodies
            If Not IsEmpty(vBodies) Then
                For Each vBody In vBodies
                    Set swBody = vBody
                    If swBody.Name = BodyName Then
                        GetCutList = swFeat.Name
                        Exit Function
                    End If
                Next
            End If
        End If
        Set swFeat = swFeat.GetNextFeature
    Wend
    GetCutList = BodyName
End Function

 

2 Likes