Welcome
Collapse Getting StartedGetting Started
Overview
SOLIDWORKS Partner Program
Expand Types of SOLIDWORKS API ApplicationsTypes of SOLIDWORKS API Applications
Expand SOLIDWORKS API Object Model and Class HierarchySOLIDWORKS API Object Model and Class Hierarchy
Collapse Programming with the SOLIDWORKS APIProgramming with the SOLIDWORKS API
Expand Add-insAdd-ins
API Dependent on SOLIDWORKS Being Visible
Arrays
Attributes Imported from ACIS SAT Files
Bitmasks
Block Definitions and Block Instances
Bodies in Body Folders
BOOL and VARIANT_BOOL
Bounding Box and Note Text
COM vs. Dispatch
CommandManager and CommandGroups
Components, Configurations, and Suppression States
Compound Note
ComVisibleAttribute in VB.NET and C# Macros and Add-ins
Controls, Visual Basic 6.0, and Windows XP
Default Paths
Drawing Views and Model Entities
Early and Late Binding
Expand EventsEvents
Features of Components
Helper Functions
Hole Wizard Features and Objects
IDispatch Object Arrays as Input in .NET
Implementation Guidelines
Import and Export File Options
In-process Methods
Instantiate ActiveX Controls as Tabs
Interface Pointers
ISafeArrayUtility Interface Overview
Keystrokes and Accelerator Keys
Library Features and Objects
Lightweight Components
Line Attributes for View::GetPolyLinesAndCurves
Line Weights
Long vs. Integer
Expand Macro FeaturesMacro Features
Manipulators
Mass Properties
Expand Multibody PartsMultibody Parts
Option Explicit Statement
Expand Packing and Unpacking Double Arrays and Integer PairsPacking and Unpacking Double Arrays and Integer Pairs
Partition Rollback and API Handles
Pattern Features and their Feature Data Objects
Persistent Reference IDs
Presentation Transforms
Expand PropertyManager PagesPropertyManager Pages
.NET Interop Assemblies
Quick Tips and Bubble ToolTips
Return Values
Expand SafeArraysSafeArrays
Selection Criteria
Selection Lists
Selections that Define Features
Setup Project to Distribute SOLIDWORKS Add-in
Smart Pointers
SOLIDWORKS Add-ins
SOLIDWORKS Connected
SOLIDWORKS Objects
Sorting Tables
Splines
SQLite
STL Container Classes and Smart Pointers
Suspend Automatic Rebuilds
Sweep Features and SweepFeatureData Objects
System Options and Document Properties
Tessellation and Edges
Third-party Data in SOLIDWORKS Files
Thread Features and ThreadFeatureData Objects
Tracking IDs
Expand Type LibrariesType Libraries
Units
Unmanaged C++ and C++/CLI Code
VBA and SOLIDWORKS x64
Examples and Projects
Expand SOLIDWORKS API HelpSOLIDWORKS API Help
Expand SOLIDWORKS Electrical API HelpSOLIDWORKS Electrical API Help
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 Connected

As of SOLIDWORKS 2020 SP03.1, SOLIDWORKS can run on the 3DEXPERIENCE platform as SOLIDWORKS Connected. SOLIDWORKS Connected provides access to all the 3DEXPERIENCE services and apps that you are entitled to use based on your role. Before using the SOLIDWORKS APIs with SOLIDWORKS Connected, you must install and set up roles and collaborative spaces in the 3DEXPERIENCE platform and install SOLIDWORKS Connected.

Read SOLIDWORKS Connected Help > Installation.

Using SOLIDWORKS APIs with SOLIDWORKS Connected

As with SOLIDWORKS Desktop, you can use the Macro toolbar in SOLIDWORKS Connected to create and edit macros. Macros are saved in the local directories that you specify. You can make references to type libraries and interop assemblies in the local SOLIDWORKS installation that SOLIDWORKS Connected deploys. You can also presume that most of your working SOLIDWORKS macros will also work with SOLIDWORKS Connected. However due 3DEXPERIENCE file storage, some SOLIDWORKS APIs have been added, changed, or discontinued for use with SOLIDWORKS Connected.

Note the following:

  • SOLIDWORKS Connected opens 3DEXPERIENCE documents with limited options. See the ISldWorks::OpenDoc7 and IDocumentSpecification Remarks.

    • Open a part in one of two modes: Resolved or Quick View.

    • Open an assembly in one of three modes: Large Design Review, LightWeight, or Resolved. You can also opt to use Speedpak and load hidden components.

    • Open a drawing in one of four modes: Quick View, Detailing, LightWeight, or Resolved. You can also opt to use Speedpak.

    • See IDocumentSpecification::Selective, IDocumentSpecification::LightWeight, IDocumentSpecification::UseLightWeightDefault, IDocumentSpecification::ViewOnly, IDocumentSpecification::DetailingMode, IDocumentSpecification::UseSpeedPak, and IDocumentSpecification::IgnoreHiddenComponents.

  • Documents opened with SOLIDWORKS Connected can be saved only to a 3DEXPERIENCE collaborative space that you previously set up. Documents cannot be saved locally and, once saved to the 3DEXPERIENCE platform with SOLIDWORKS Connected, cannot be retrieved from outside of the 3DEXPERIENCE platform.

  • Documents that have been saved with either SOLIDWORKS Desktop or SOLIDWORKS Connected can be opened with SOLIDWORKS Connected. However, documents saved with SOLIDWORKS Connected can only be opened from within the 3DEXPERIENCE platform or with SOLIDWORKS Connected.

  • SOLIDWORKS Connected employs the Product Lifecycle Management (PLM) software provided by 3DEXPERIENCE. Therefore, the SOLIDWORKS PDM Pro API does not work with SOLDWORKS Connected.

APIs that support opening and saving documents with SOLIDWORKS Connected are available as of SOLIDWORKS 2020 SP03.1. In future releases, more APIs specific to SOLIDWORKS Connected functionality may be added. You should always read the API Help Release Notes in each service pack to learn about API changes for SOLIDWORKS Connected functionality. Use the Index and Search tabs in the SOLIDWORKS API Help to search for "3DEXPERIENCE" or "SOLIDWORKS Connected".

After you install SOLIDWORKS Connected, run the following two examples in order:

Example 1: Save a SOLIDWORKS Connected document

' VBA

' Preconditions: Open a new part with SOLIDWORKS Connected.

' Postconditions:

' 1. NonActiveSave.sldprt is saved to a collaborative space on the 3DEXPERIENCE platform.

' 2. Use 3DEXPERIENCE 3DSearch to find NonActiveSave.sldprt on the 3DEXPERIENCE platform.

' 3. Do not close the document as Example 2 requires that it be open.

Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swModExt As SldWorks.ModelDocExtension
Dim swSaveTo3DExp As SldWorks.SaveTo3DExperienceOptions
Dim strFileName, strComment As String
Dim bStat As Boolean
Dim lError As Long
Dim IWarning As Long

Sub main()

     Set swApp = Application.SldWorks
     Set swModel = swApp.ActiveDoc
     Set swModExt = swModel.Extension

      If swApp.ApplicationType = swApplicationType_3DEXPERIENCE Then


          Set swSaveTo3DExp = swApp.GetSaveTo3DExperienceOptions

          strFileName = "NonActiveSave.sldprt"
          strComment = "No comment"
          swSaveTo3DExp.FileName = strFileName
          bStat = swSaveTo3DExp.SetRevisionComments(strComment)

          bStat = swModExt.SaveTo3DExperience(swSaveTo3DExp, lError, IWarning)

     End If

End Sub

Example 2: Open a SOLIDWORKS Connected document

' VBA

' Preconditions:
' 1. NonActiveSave.sldprt is open in SOLIDWORKS Connected.
' 2. Open the Immediate window.
' 3. Run the macro.
' 4. When the macro stops, close the document.
' 5. Press F5 to reopen the 3DEXPERIENCE document.

' Postconditions: NonActiveSave.sldprt is re-opened from the 3DEXPERIENCE platform.

Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim swModExt As SldWorks.ModelDocExtension
Dim swPart As SldWorks.PartDoc
Dim swPLMObjectSpecification As SldWorks.PLMObjectSpecification
Dim swDocSpecification As SldWorks.DocumentSpecification
Dim strPartTitle As String
Dim strPLMid As String


Sub main()

     Set swApp = Application.SldWorks
     Set swModel = swApp.ActiveDoc
     Set swModExt = swModel.Extension

     If swApp.ApplicationType = swApplicationType_3DEXPERIENCE Then

          strPLMid = swModExt.GetPLMID
          Debug.Print swModel.GetPathName & " " & strPLMid

          Stop 'Close document in the user interface

          'Open 3DEXPERIENCE document using the API
  
          Set swDocSpecification = swApp.GetOpenDocSpec("")
          Set swPLMObjectSpecification = swDocSpecification.PLMObjectSpecification
          swPLMObjectSpecification.PLMID = strPLMid

          Set swModel = swApp.OpenDoc7(swDocSpecification)

     End If

End Sub

Also see the IPLMObjectSpecification .NET examples.



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 Connected
*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.