Hide Table of Contents
InsertObjectFromFile Method (IModelDocExtension)

Inserts an OLE object from a file.

.NET Syntax

Visual Basic (Declaration) 
Function InsertObjectFromFile( _
   ByVal FilePath As System.String, _
   ByVal CreateLink As System.Boolean, _
   ByVal Aspect As System.Integer, _
   ByVal XPos As System.Double, _
   ByVal YPos As System.Double, _
   ByVal ZPos As System.Double _
) As SwOLEObject
Visual Basic (Usage) 
Dim instance As IModelDocExtension
Dim FilePath As System.String
Dim CreateLink As System.Boolean
Dim Aspect As System.Integer
Dim XPos As System.Double
Dim YPos As System.Double
Dim ZPos As System.Double
Dim value As SwOLEObject
value = instance.InsertObjectFromFile(FilePath, CreateLink, Aspect, XPos, YPos, ZPos)
SwOLEObject InsertObjectFromFile( 
   System.string FilePath,
   System.bool CreateLink,
   System.int Aspect,
   System.double XPos,
   System.double YPos,
   System.double ZPos
SwOLEObject^ InsertObjectFromFile( 
&   System.String^ FilePath,
&   System.bool CreateLink,
&   System.int Aspect,
&   System.double XPos,
&   System.double YPos,
&   System.double ZPos


Path and filename for the OLE object file

True to create an external link to the OLE object file, false to embed the OLE object on the document

Viewing aspect of the object as defined in the DVASPECT enumeration (see Remarks)
x coordinate for the OLE object

y coordinate for the OLE object

z coordinate for the OLE object

Return Value

Newly inserted object


Currently, only the drawing documents use the x,y,z coordinate position. Part and assembly documents place the inserted object at the upper-right corner of the model view.


The aspect argument uses the DVASPECT enumeration, which has the following values:





See the MSDN documentation for additional details about the DVASPECT enumeration.


See Also


SOLIDWORKS 2006 FCS, Revision Number 14.0

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

Subject:   Feedback on Help Topics
Page:   InsertObjectFromFile Method (IModelDocExtension)
*   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:


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

Web Help Content Version: API Help (English only) 2017 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.