Hide Table of Contents
LoadFile4 Method (ISldWorks)

Loads a third-party native CAD file into a new SOLIDWORKS document using 3D Interconnect.

.NET Syntax

Visual Basic (Declaration) 
Function LoadFile4( _
   ByVal FileName As System.String, _
   ByVal ArgString As System.String, _
   ByVal ImportData As System.Object, _
   ByRef Errors As System.Integer _
) As ModelDoc2
Visual Basic (Usage) 
Dim instance As ISldWorks
Dim FileName As System.String
Dim ArgString As System.String
Dim ImportData As System.Object
Dim Errors As System.Integer
Dim value As ModelDoc2
 
value = instance.LoadFile4(FileName, ArgString, ImportData, Errors)
C# 
ModelDoc2 LoadFile4( 
   System.string FileName,
   System.string ArgString,
   System.object ImportData,
   out System.int Errors
)
C++/CLI 
ModelDoc2^ LoadFile4( 
&   System.String^ FileName,
&   System.String^ ArgString,
&   System.Object^ ImportData,
&   [Out] System.int Errors
) 

Parameters

FileName
Full path and file name of the third-party native CAD part or assembly document to import (see Remarks)
ArgString
Space-separated string that allows optional arguments to be specified when opening a third-party native CAD file; empty string if 3D Interconnect is enabled (see Remarks)
ImportData
IImportIgesDataIImportDxfDwgData, or IImportStepData object; null or Nothing if 3D Interconnect is not enabled (see Remarks)
Errors
Errors as defined in swFileLoadError_e

Return Value

Model document

Example

Remarks

This method:

  • Uses 3D Interconnect to load FileName into a new SOLIDWORKS document. Before calling this method, turn on 3D Interconnect by setting Tools > Options > System Options > Import > Enable 3D Interconnect or calling ISldWorks::SetUserPreferenceToggle(swUserPreferenceToggle_e.swMultiCAD_Enable3DInterconnect, True). With 3D Interconnect enabled, this method supports the following third-party native CAD formats and versions:
    • ACIS: .sat, .sab, .asat, .asab for r1 - 2018 1.0
    • Autodesk® Inventor: .ipt for V6-V2018, .iam for V11 - V2018
    • CATIA® V5: .CATPart, .CATProduct for V5R8 - V5-6R2017
    • IGES: .igs, .iges for up to 5.3
    • JT: .jt for JT 8.x, 9.x, and 10.x
    • PTC®: .prt, .prt.*, .asm.* for Pro/ENGINEER® 16 - Creo 4.0
    • Solid Edge®: .par, .asm, .psm for V18 - ST10
    • STEP: .stp, .step for AP203, AP214, AP24
    • NX™ software: .prt for UG 11 - NX 11
  • Imports FileName into the appropriate native SOLIDWORKS part or assembly.
    • For parts, the SOLIDWORKS file created is a copy of the original non-native file. The copy retains an external reference to the original CAD file. If the original third-party native file is modified in its orginal application, the SOLIDWORKS copy can be updated to import those changes. Changes to the SOLIDWORKS copy do not propagate back to the original file.
    • For assemblies, you must save the new SOLIDWORKS assembly in order for SOLIDWORKS to import the third-party native assembly and create the copy. Only after saving the new SOLIDWORKS assembly can you edit the imported top-level assembly or break its reference link. Editing lower-level components of the imported top-level assembly or individually breaking their reference links is not supported.
    • See the IImport3DInterconnectData Remarks for information about editing imported CAD data and breaking reference links to third-party native CAD parts and assemblies.
  • Imports the geometry as a featureless solid body. 
  • Does not import FileName into any existing SOLIDWORKS file or the active document. To import a third-party native CAD file into an existing SOLIDWORKS:
  • Imports third-party native CAD files using different behavior if 3D Interconnect is not enabled:

If 3D Interconnect is not enabled and you are importing...

Then...

Third-party native CAD files

Set ArgString to FWNS to display a FeatureWorks dialog after opening.

Pro/E files

  • To import features, set ArgString to R

  • To import geometry, set ArgString to:

    • B Direct geometry import with knitting

    • C Direct geometry import without knitting

    • D Geometry import with knitting

    • E Geometry import without knitting

    • S Surface geometry import with knitting

These arguments are case sensitive. Specifying one of these options suppresses dialog.

Non DXF/DWG and Non Pro/E files

  • To import the foreign file into a new SOLIDWORKS document, set ArgString to r.

For example, to import an IGES file named cup.igs into a new SOLIDWORKS document:

Set swModel = swApp.LoadFile4 "D:\Samples\cup.IGS", "r", importData, Err.

See IImportIgesData for details about importing IGES data.

NOTES:

  • Whether the result is a surface or solid depends on the import options. See Import and Export File Options for details.

  • If ArgString is set to an empty string, then dialogs may be presented to the end-user during translation. 

DXF/DWG files

You can:

  • Let SOLIDWORKS determine the default values:

    • Paper size and sheet scale are computed to fit the input data.

    • Length unit is determined from the header of the input DXF/DWG file.

    • Sheet name is the same as the layout name in the input DXF/DWG file.

 - or -

See IImportDxfDwgData for details about importing DXF/DWG data.

NOTES:

  • Getting the IImportDxfDwgData interface does not get default values from the input file. Any values not set by you are set to the values computed by SOLIDWORKS.

  • If the DWG/DXF file has multiple sheets, use these methods with a valid layout name in the Sheet argument to set up sheet specific settings, which overrides the default settings. If any of the individual items are not specified for a given layout name, the value used is from the defaults (layout name ""). If the default value is not specified, SOLIDWORKS computes and uses a meaningful value for that item.

 

 

See Also

Availability

SOLIDWORKS 2006 SP1, Revision Number 14.1


Provide feedback on this topic

SOLIDWORKS welcomes your feedback concerning the presentation, accuracy, and thoroughness of the documentation. Use the form below to send your comments and suggestions about this topic directly to our documentation team. The documentation team cannot answer technical support questions. Click here for information about technical support.

* Required

 
*Email:  
Subject:   Feedback on Help Topics
Page:   LoadFile4 Method (ISldWorks)
*Comment:  
*   I acknowledge I have read and I hereby accept the privacy policy under which my Personal Data will be used by Dassault Systèmes

Print Topic

Select the scope of content to print:

x

We have detected you are using a browser version older than Internet Explorer 7. For optimized display, we suggest upgrading your browser to Internet Explorer 7 or newer.

 Never show this message again
x

Web Help Content Version: API Help (English only) 2020 SP05

To disable Web help from within SOLIDWORKS and use local help instead, click Help > Use SOLIDWORKS Web Help.

To report problems encountered with the Web help interface and search, contact your local support representative. To provide feedback on individual help topics, use the “Feedback on this topic” link on the individual topic page.