Collapse Getting StartedGetting Started
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
Attributes Imported from ACIS SAT Files
Block Definitions and Block Instances
Bodies in Body Folders
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
Gtol Frame XML Schema
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
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
Sorting Tables
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
Unmanaged C++ and C++/CLI Code
Examples and Projects
Expand SOLIDWORKS Electrical API HelpSOLIDWORKS Electrical API Help
Expand SOLIDWORKS PDM Professional API HelpSOLIDWORKS PDM Professional API Help
Expand PDM Pro API Web ServicePDM Pro API Web Service
Expand FeatureWorks API HelpFeatureWorks API Help
Expand SOLIDWORKS Document Manager API HelpSOLIDWORKS Document Manager API Help
Expand SOLIDWORKS Inspection API HelpSOLIDWORKS Inspection API Help
Expand SOLIDWORKS Simulation API HelpSOLIDWORKS Simulation API Help
Expand SOLIDWORKS Sustainability API HelpSOLIDWORKS Sustainability 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

Sweep  Features and SweepFeatureData Objects

To create a Sweep feature:

  • See the ISweepFeatureData examples.

  • Open a part in SOLIDWORKS and create a profile and a path along which to sweep the profile. Create guide curves, if using a sketch profile.

  • In a macro:

    • Access the part.
    • Call IModelDocExtension::SelectByRay to select the:
      1. Profile:
        • If a sketch profile, use Mark = 1 to select a face, edge, or curve. For a swept-boss feature, the sketch profile must be closed. For a swept-surface feature, the sketch profile is open or closed.
        • If a circular profile, use Mark = 4 to select a sketch line, edge or curve. The circular profile is open or closed.
        • If a solid profile, use Mark = 1 to select the tool body to use to make the cut and use Mark = 2048 to select the solid body to cut. Solid profiles are used only in swept-cut features.
      2. Sweep path using Mark = 4:
        • Select a set of sketched curves contained in one sketch, a curve, or a set of model edges.
        • The sweep path is open or closed.
        • The starting point of the sweep path must lie on the plane of the profile for a 1-directional sweep. If the sweep path extends to both sides of the profile, you can create a bidirectional sweep.
        • Sweep paths are not used with circular profiles.
      3. Guide curves using Mark = 2:
        • Guide curves are used only with sketch profiles.
        • A guide curve must be coincident with the sketch profile or with a point on the profile sketch.
        • Guide curves are not used in bidirectional sweeps.
      4. Direction vector using Mark = 128:
        • Select a plane, face, line, axis, edge, cylinder, or a pair of vertices that define the direction.
    • To create a SweepFeatureData object and initialize it with default properties for a:

      • Swept-boss feature, call IFeatureManager::CreateDefinition(swFmSweep).
      • Swept-cut feature, call IFeatureManager::CreateDefinition(swFmSweepCut).
      • Swept-surface feature, call IFeatureManager::CreateDefinition(swFmRefSurface).
    • If you specified a direction vector in step 3.2.4 above, then before creating the sweep feature you must:
    • Before creating a thin-walled swept-cut or swept-boss feature, you must:
    • Modify other ISweepFeatureData properties that apply to the selected profile. For example for a sketch profile, if the sweep path extends to both sides of the profile, you can make the sweep bidirectional by setting ISweepFeatureData::Direction. See the SOLIDWORKS help and ISweepFeatureData for more information about sweep feature properties.
    • Create the sweep feature by calling IFeatureManager::CreateFeature(SweepFeatureData object).

To edit the Sweep feature:

  1. Call IFeature::GetDefinition to access the SweepFeatureData object.
  2. Call ISweepFeatureData::AccessSelections.
  3. Modify ISweepFeatureData object properties. Note that you cannot create a thin-walled sweep feature at this point.
  4. Call IFeature::ModifyDefinition, if you modified the feature, or ISweepFeatureData::ReleaseSelectionAccess, if you did not modify the feature.




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:   Sweep  Features and SweepFeatureData Objects
*   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) 2023 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.