Save as STEP file Macro

Quick and easy macro to one-click save a part or assembly drawing as a STEP file, saving you about 4 clicks. Great for lazy people.

  1. Step 1: Raw VBA Macro

    Just copy paste this into a new macro


    Dim swApp As Object

    Dim Part As Object

    Dim SelMgr As Object

    Dim boolstatus As Boolean

    Dim longstatus As Long, longwarnings As Long

    Dim Feature As Object

    Dim Step As Long


    Sub main()


    Set swApp = Application.SldWorks


    Set Part = swApp.ActiveDoc

    Set SelMgr = Part.SelectionManager


    Step = swApp.SetUserPreferenceIntegerValue(swStepAP, 203)


    sPathName = Part.GetPathName

    sPathName = Left(sPathName, Len(sPathName) - 6)

    sPathName = sPathName + "STEP"

    Part.SaveAs2 sPathName, 0, True, False


    MsgBox ("File saved as STEP203 at " & sPathName)


    End Sub



Comments