Hide Table of Contents
SetSmartComponentData Method (IComponent2)

Sets the features, components, and feature references of a Smart Component.

.NET Syntax

Visual Basic (Declaration) 
Function SetSmartComponentData( _
   ByVal FeaturesSelected As System.Object, _
   ByVal ComponentsSelected As System.Object, _
   ByVal References As System.Object _
) As System.Boolean
Visual Basic (Usage) 
Dim instance As IComponent2
Dim FeaturesSelected As System.Object
Dim ComponentsSelected As System.Object
Dim References As System.Object
Dim value As System.Boolean
value = instance.SetSmartComponentData(FeaturesSelected, ComponentsSelected, References)
System.bool SetSmartComponentData( 
   System.object FeaturesSelected,
   System.object ComponentsSelected,
   System.object References
System.bool SetSmartComponentData( 
&   System.Object^ FeaturesSelected,
&   System.Object^ ComponentsSelected,
&   System.Object^ References


Array of boolean values indicating which features to enable in the Smart Component (see Remarks)
Array of boolean values indicating which components to enable in the Smart Component (see Remarks)
Array of feature reference entities in the target assembly that are used to activate the features specified by FeaturesSelected (see Remarks)

Return Value

True if successful, false if not



A Smart Component is defined by its:

  • Components
  • Features
  • Feature references

See the SOLIDWORKS Help for more information about Smart Components.

Use this method to:

  • Change which features and components to enable in a Smart Component.
  • Activate the Smart Features.

Before calling this method:

  1. Open an assembly that contains a Smart Component whose Smart Features have not yet been activated.
  2. Find the Smart Component in the assembly using IComponent2::IsSmartComponent.
  3. Call IComponent2::GetSmartComponentData to obtain the current feature and component arrays for the Smart Component.
  4. Create two boolean arrays whose elements map one-to-one with the elements in the feature and component arrays.
  5. For each element in each boolean array, specify true if the corresponding feature or component is enabled in the Smart Component. Specify false if it is not.
  6. Set FeaturesSelected and ComponentsSelected with the corresponding boolean arrays.
  7. Create an array of reference entities (e.g., faces, edges, points) selected from the target assembly that map to the feature reference entities that were defined for the Smart Component.
  8. Set References to the array of reference entities.

Use ISmartComponentFeatureData to:

  • Insert new features and components into a Smart Component.
  • Delete features and components from a Smart Component.

See Also


SOLIDWORKS 2012 FCS, Revision Number 20.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:   SetSmartComponentData Method (IComponent2)
*   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.