Hide Table of Contents
LoadFile4 Method (ISldWorks)

Loads a non-native SolidWorks file (for example, *.igs, *.dxf, and so on) into a new model document.

.NET Syntax

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

Parameters

FileName
Full path and filename of the non-native SolidWorks file to import
ArgString
Space-separated string that allows optional arguments to be specified when opening a foreign file (see Remarks)
ImportData
IImportIgesData or IImportDxfDwgData object (see Remarks)
Errors

Errors as defined in swFileLoadError_e

Return Value

Model document

Example

Remarks

The general form of ArgString is BOOLEAN and enumerator arguments, which should be passed as a string.

If importing...

Then...

Non-native 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 Pro/E files

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

  • To insert the foreign file into an existing SolidWorks part document, set ArgString to i

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) 2012 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.