Welcome
Expand Getting StartedGetting Started
Expand SOLIDWORKS API HelpSOLIDWORKS API Help
Collapse SOLIDWORKS Electrical API HelpSOLIDWORKS Electrical API Help
Expand Getting StartedGetting Started
Expand Release NotesRelease Notes
Collapse ClassesClasses
Expand Class ListClass List
Class Index
Collapse Class HierarchyClass Hierarchy
_DIEwProjectXEvents
Collapse IDispatchIDispatch
IEwAddIn
IEwAPIX
IEwApplicationReactorX
IEwApplicationSettingsX
IEwApplicationX
IEwArchiveEnvironmentX
IEwCableCoreX
IEwCableReferenceManagerX
IEwCableReferenceX
IEwCommandContextX
IEwCommandManagerX
IEwCommandX
IEwDialogAlignPartsParametersSelectorX
IEwDialogLocationSelectorX
IEwDialogMacroSelectorX
IEwDialogManufacturerPartOrderingX
IEwDialogManufacturerPartSelectorX
IEwDialogProgressX
IEwDialogProjectManagerX
IEwDialogResumeX
IEwDialogSummaryX
IEwDialogTaskX
IEwDockingPaneManagerX
IEwDockingPaneX
IEwEnvironmentX
IEwInteropFactoryX
IEwLibraryManagerX
IEwLibraryX
IEwLockStringX
IEwManufacturerPartCircuitX
IEwManufacturerPartManagerX
IEwManufacturerPartTerminalX
IEwManufacturerPartX
Collapse IEwObjectBaseXIEwObjectBaseX
IEwPointX
IEwProjectAutomaticArrowsX
IEwProjectBookManagerX
IEwProjectCableManagerX
IEwProjectComponentManagerX
IEwProjectComponentTerminalX
IEwProjectEntity3DManagerX
IEwProjectExcelAutomationX
IEwProjectExportDWGFilesX
IEwProjectExportPDFX
IEwProjectExportPDMX
IEwProjectExportReportX
IEwProjectFileManagerX
IEwProjectFolderManagerX
IEwProjectFunctionManagerX
IEwProjectGenerateTSDrawingX
IEwProjectHarnessManagerX
IEwProjectInputOutputManagerX
IEwProjectLocationManagerX
IEwProjectManagerX
IEwProjectManufacturerPartCircuitX
IEwProjectManufacturerPartManagerX
IEwProjectManufacturerPartTerminalX
IEwProjectManufacturerPartX
IEwProjectNumberDocumentsX
IEwProjectNumberMarksX
IEwProjectNumberWiresX
IEwProjectOptimizeWireOrderX
IEwProjectPrintConfigManagerX
IEwProjectReportManagerX
IEwProjectSnapshotManagerX
IEwProjectSnapshotX
IEwProjectSymbolManagerX
IEwProjectUpdateReplaceDataX
IEwProjectWireManagerX
IEwProjectX
IEwResumeRowX
IEwRibbonControlX
IEwRibbonGroupX
IEwRibbonTabX
IEwRibbonX
IEwRightsManagerX
IEwSymbolCircuitX
IEwSymbolFiltersX
IEwSymbolManagerX
IEwSymbolPointX
IEwSymbolX
IEwTitleBlockManagerX
IEwTitleBlockX
IEwXLSBookX
IEwXLSSheetX
Expand Class MembersClass Members
Expand SOLIDWORKS PDM Professional API HelpSOLIDWORKS PDM Professional API Help
Expand FeatureWorks API HelpFeatureWorks API Help
Expand SOLIDWORKS Costing API HelpSOLIDWORKS Costing API Help
Expand SOLIDWORKS Document Manager API HelpSOLIDWORKS Document Manager API Help
Expand SOLIDWORKS Routing API HelpSOLIDWORKS Routing API Help
Expand SOLIDWORKS Simulation API HelpSOLIDWORKS Simulation API Help
Expand SOLIDWORKS Sustainability API HelpSOLIDWORKS Sustainability API Help
Expand SOLIDWORKS Toolbox API HelpSOLIDWORKS Toolbox API Help
Expand SOLIDWORKS Utilities API HelpSOLIDWORKS Utilities API Help
Expand eDrawings API HelpeDrawings API Help
Expand DraftSight API HelpDraftSight API Help
Expand Lisp Programming BasicsLisp Programming Basics
Expand Lisp Functions OverviewLisp Functions Overview
Expand Lisp Functions ReferenceLisp Functions Reference
Expand Visual Lisp Compatible FunctionsVisual Lisp Compatible Functions
Hide Table of Contents
SOLIDWORKS Electrical API  2021.0.0
Electrical API
IEwProjectFileX Interface Reference

Use this interface to manage file inside a project. More...

Inheritance diagram for IEwProjectFileX:

Public Member Functions

IEwProjectLocationX getEwProjectLocation (EwErrorCode *errorCode)
 IEwProjectLocationX associated with the file. More...
 
BSTR getFilePath (EwErrorCode *errorCode)
 Return the file path. More...
 
EwErrorCode lock ()
 Lock the file so no one connected to the collaborative server can edit or delete it. More...
 
EwErrorCode unlock ()
 Unlock the file. More...
 
EwFileType getFileType ()
 
LONG getPosition (EwErrorCode *errorCode)
 Get the position of files inside a book/folder. More...
 
LONG getEwProjectBookID (EwErrorCode *errorCode)
 Get the ID of the book containing this file. More...
 
LONG getEwProjectFolderID (EwErrorCode *errorCode)
 Get the ID of the folder containing this file. More...
 
EwErrorCode setEwProjectBookID (LONG lID)
 Set the Book ID of this file. More...
 
EwErrorCode setEwProjectFolderID (LONG lID)
 Set the folder ID as parent for this file. More...
 
VARIANT_BOOL isOpen (EwErrorCode *errorCode)
 Return true if the project file is open. More...
 
EwErrorCode open ()
 Open the project file. More...
 
EwErrorCode close ()
 Close the project file. More...
 
EwErrorCode setFileType (EwFileType eFileType)
 Set the file type of the current project file. More...
 
EwErrorCode setOriginalFilePath (BSTR strFilePath, VARIANT_BOOL bAsShortCut)
 Specify the path of the file to add in the project. More...
 
BSTR getTargetFilePath (EwErrorCode *errorCode)
 Return the path to a file not only a reference to a *.lnk. More...
 
VARIANT_BOOL isLockByMe (EwErrorCode *errorCode)
 Return true if the project file is lock by me. More...
 
VARIANT_BOOL isLockedByAnother (EwErrorCode *errorCode)
 Return true if the project file is lock by another. More...
 
- Public Member Functions inherited from IEwProjectTagObjectX
EwErrorCode setUserData (LONG nUserDataNumber, BSTR strValue)
 Set user data of the object. More...
 
BSTR getUserData (LONG nUserDataNumber, EwErrorCode *errorCode)
 Get user data of the object. More...
 
EwErrorCode setTranslatedData (LONG nUserDataNumber, BSTR strLanguage, BSTR strValue)
 Set the value of a translated text. More...
 
BSTR getTranslatedData (LONG nUserDataNumber, BSTR strLanguage, EwErrorCode *errorCode)
 Get the value of a translated text. More...
 
BSTR getTag (EwErrorCode *errorCode)
 Get the mark of this object. More...
 
EwErrorCode setTag (BSTR strValue)
 Set the mark of this object. More...
 
BSTR getTagRoot (EwErrorCode *errorCode)
 Get the mark root of this object. More...
 
EwErrorCode setTagRoot (BSTR strValue)
 Set the mark root of this object. More...
 
EwTagMode getTagMode (EwErrorCode *errorCode)
 Get the mark mode of this object. More...
 
EwErrorCode setTagMode (EwTagMode eTagMode)
 Set the mark mode of this object. More...
 
long getTagNumber (EwErrorCode *errorCode)
 Get the mark number of this object. More...
 
EwErrorCode setTagNumber (long lValue)
 Set the mark number of this object. More...
 
EwErrorCode setNextTagNumber ()
 Set the next number to have a unique mark. More...
 
VARIANT_BOOL isTagUnique (EwErrorCode *errorCode)
 Returns true or false if mark is unique. More...
 
- Public Member Functions inherited from IEwObjectBaseX
EwErrorCode remove ()
 Remove the object from the current project. More...
 
EwErrorCode update ()
 Update the object inside the current project. More...
 
LONG getID ()
 

Detailed Description

Use this interface to manage file inside a project.

Since
2018 SP0

Member Function Documentation

◆ close()

EwErrorCode IEwProjectFileX::close ( )

Close the project file.

Since
2019 SP3.
Returns
EwErrorCode enum type, can be:Error code:
  • EW_NO_ERROR if no error detected.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_CANNOT_CLOSE if cannot close the project file.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not opened.

◆ getEwProjectBookID()

LONG IEwProjectFileX::getEwProjectBookID ( EwErrorCode errorCode)

Get the ID of the book containing this file.

Since
2019.
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not opened.
Returns
the ID of the book containing this folder.

◆ getEwProjectFolderID()

LONG IEwProjectFileX::getEwProjectFolderID ( EwErrorCode errorCode)

Get the ID of the folder containing this file.

If the file doesn't have parent folder it returns -1.

Since
2019
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not opened.
Returns
the ID of the folder containing this folder.

◆ getEwProjectLocation()

IEwProjectLocationX IEwProjectFileX::getEwProjectLocation ( EwErrorCode errorCode)

IEwProjectLocationX associated with the file.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_OBJECT_NOT_FOUND if object not found.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not opened.
Returns
IEwProjectLocationX pointer to the associated location. NULL if there is an error.

◆ getFilePath()

BSTR IEwProjectFileX::getFilePath ( EwErrorCode errorCode)

Return the file path.

Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not opened.
Returns
the file path.

◆ getFileType()

EwFileType IEwProjectFileX::getFileType ( )
Returns
Get an EwFileType enum file type. return kUnknowFileType if the object is invalid.

◆ getPosition()

LONG IEwProjectFileX::getPosition ( EwErrorCode errorCode)

Get the position of files inside a book/folder.

Since
2018 SP3.
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not opened.
Returns
the position of the file in the book/folder.

◆ getTargetFilePath()

BSTR IEwProjectFileX::getTargetFilePath ( EwErrorCode errorCode)

Return the path to a file not only a reference to a *.lnk.

Since
2020 SP1.
Parameters
[out]

◆ isLockByMe()

VARIANT_BOOL IEwProjectFileX::isLockByMe ( EwErrorCode errorCode)

Return true if the project file is lock by me.

Since
2020 SP
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not open.
Returns
true if the project file is lock by me.

◆ isLockedByAnother()

VARIANT_BOOL IEwProjectFileX::isLockedByAnother ( EwErrorCode errorCode)

Return true if the project file is lock by another.

Since
2020 SP4
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not open.
Returns
true if the project file is lock by another.

◆ isOpen()

VARIANT_BOOL IEwProjectFileX::isOpen ( EwErrorCode errorCode)

Return true if the project file is open.

Since
2019 SP3
Parameters
[out]errorCodeEwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not open.
Returns
true if the project file is opened.

◆ lock()

EwErrorCode IEwProjectFileX::lock ( )

Lock the file so no one connected to the collaborative server can edit or delete it.

Returns
EwErrorCode enum type, can be:Error code:
  • EW_NO_ERROR if no error detected.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not opened.

◆ open()

EwErrorCode IEwProjectFileX::open ( )

Open the project file.

Since
2019 SP3.
Returns
EwErrorCode enum type, can be:Error code:
  • EW_NO_ERROR if no error detected.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_CANNOT_OPEN if cannot open the project file.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not opened.

◆ setEwProjectBookID()

EwErrorCode IEwProjectFileX::setEwProjectBookID ( LONG  lID)

Set the Book ID of this file.

The parent folder ID is set to -1. If the Book and the Folder are not specified, the default book is used. Can be used only before calling insert.

Since
2019
Parameters
[in]lIDID of the book to set.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected.
  • EW_BAD_INPUTS if the new value is < 1 or this file is already inserted.
  • EW_OBJECT_NOT_FOUND if the book ID does not exist.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not opened.

◆ setEwProjectFolderID()

EwErrorCode IEwProjectFileX::setEwProjectFolderID ( LONG  lID)

Set the folder ID as parent for this file.

Book ID of the file will also be updated if the book of the new parent folder is different from the one already define. If the Book and the Folder are not specified, the default book is used. Can be used only before calling insert.

Since
2019.
Parameters
[in]lIDID of the new parent folder.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected.
  • EW_BAD_INPUTS if the new value is < 1 or this file is already inserted.
  • EW_OBJECT_NOT_FOUND if folder associated with this ID doesn't exist.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not opened.

◆ setFileType()

EwErrorCode IEwProjectFileX::setFileType ( EwFileType  eFileType)

Set the file type of the current project file.

If the file is already inserted, only kFileFolio to kFileMixed or kFileLineDiagram to kFileMixed enum are allowed.

Since
2020 SP0.
Parameters
[in]eFileTypeThe new file type.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected.
  • EW_BAD_INPUTS if eFileType is a non valid File enum (kUnknowFileType or kFileMax).
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not opened.

◆ setOriginalFilePath()

EwErrorCode IEwProjectFileX::setOriginalFilePath ( BSTR  strFilePath,
VARIANT_BOOL  bAsShortCut 
)

Specify the path of the file to add in the project.

Use this method to add an existing file or a shortcut to the project. When calling this method the file type is also updated to kOther or kFileAppendixDxfDwg for dwg and dxf files. It doesn't work on already existing files.

Since
2020 SP0.
Parameters
[in]strFilePathFull file path.
[in]bAsShortCutset to true to specify that the file must be added as a shortcut.
Returns
EwErrorCode enum type, can be:
  • EW_NO_ERROR if no error detected.
  • EW_FILE_NOT_FOUND if file path does not exist.
  • EW_OBJECT_ALREADY_INSERTED if the file is already inserted and cannot be modified by this interface. Create a new one to do this.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not opened.

◆ unlock()

EwErrorCode IEwProjectFileX::unlock ( )

Unlock the file.

Returns
EwErrorCode enum type, can be:Error code:
  • EW_NO_ERROR if no error detected.
  • EW_UNDEFINED_ERROR if another error occurred.
  • EW_INVALID_OBJECT if object base not initialized.
  • EW_PROJECT_NOTOPENED if project not opened.


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:   SOLIDWORKS Electrical API: IEwProjectFileX Interface Reference
*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) 2021 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.