Loadfile2 Command to load a DXF file
Loadfile2 Command to load a DXF file
(OP)
Is there a way to use the Loadfile2 command to load a DXF file into the sketch of a part rather than into a drawing template?
This is what the recorded code reads, but when you run it, it tries to load a drawing file instead loading the dxf file into the sketch of a part file as what I did when I recorded the macro:
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Sub main()
Set swApp = Application.SldWorks
swApp.LoadFile2 "C:\cutter.dxf", "0 0"
Set Part = swApp.ActiveDoc
End Sub
The reason why i want to use the Loadfile2 command is that I can set the units of the dxf file with this command as mm.
This is what the recorded code reads, but when you run it, it tries to load a drawing file instead loading the dxf file into the sketch of a part file as what I did when I recorded the macro:
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Sub main()
Set swApp = Application.SldWorks
swApp.LoadFile2 "C:\cutter.dxf", "0 0"
Set Part = swApp.ActiveDoc
End Sub
The reason why i want to use the Loadfile2 command is that I can set the units of the dxf file with this command as mm.





