Hide Table of Contents
SetComponentIdentifiers Method (IFeatureManager)

Allows you to specify the primary, ( secondary ), and < tertiary > elements to display for the components in the FeatureManager design tree.

.NET Syntax

Visual Basic (Declaration) 
Function SetComponentIdentifiers( _
   ByVal Primary As System.Integer, _
   ByVal Secondary As System.Integer, _
   ByVal Tertiary As System.Integer _
) As System.Integer
Visual Basic (Usage) 
Dim instance As IFeatureManager
Dim Primary As System.Integer
Dim Secondary As System.Integer
Dim Tertiary As System.Integer
Dim value As System.Integer
 
value = instance.SetComponentIdentifiers(Primary, Secondary, Tertiary)
C# 
System.int SetComponentIdentifiers( 
   System.int Primary,
   System.int Secondary,
   System.int Tertiary
)
C++/CLI 
System.int SetComponentIdentifiers( 
&   System.int Primary,
&   System.int Secondary,
&   System.int Tertiary
) 

Parameters

Primary
Component identifier as defined by swComponentIdentifier_e
Secondary
Component identifier(s) as defined by swComponentIdentifier_e
Tertiary
Component identifier(s) as defined by swComponentIdentifier_e

Return Value

Result code as defined by swSetComponentIdentifierResult_e

Example

'VBA

'-------------------------------------------------------
' Preconditions:
' 1. Open public_documents\SOLIDWORKS\SOLIDWORKS 2022\samples\tutorial\smartcomponents\pillow_block.sldasm.
' 2. Widen the FeatureManager design tree.
'
' Postconditions: Inspect the FeatureManager design tree and press F5 after each Stop.
'
' Notes: Because the model is used elsewhere, do not save changes.
'-------------------------------------------------------
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim Part As SldWorks.ModelDoc2
Dim swFeatMgr As SldWorks.FeatureManager
Dim compIdentifierRet As Long

Sub main()
    Set swApp = Application.SldWorks
    Set Part = swApp.ActiveDoc
    Set swFeatMgr = Part.FeatureManager
   
    ' Do show configuration or display state name if only one exists
    swFeatMgr.HideComponentSingleConfigurationOrDisplayStateNames = False

    ' Set primary identifier
    compIdentifierRet = swFeatMgr.SetComponentIdentifiers(swComponentIdentifier_ComponentName, 0, 0)
    Stop
   
    compIdentifierRet = swFeatMgr.SetComponentIdentifiers(swComponentIdentifier_ComponentDescription, 0, 0)
    Stop
   
    ' Set primary and secondary identifiers
    compIdentifierRet = swFeatMgr.SetComponentIdentifiers(swComponentIdentifier_ComponentName, swComponentIdentifier_ConfigurationName, 0)
    Stop
   
    compIdentifierRet = swFeatMgr.SetComponentIdentifiers(swComponentIdentifier_ComponentName, swComponentIdentifier_ConfigurationDescription, 0)
    Stop
   
    compIdentifierRet = swFeatMgr.SetComponentIdentifiers(swComponentIdentifier_ComponentName, swComponentIdentifier_ComponentDescription, 0)
    Stop
   
    'Set primary, secondary, and tertiary identifiers
    compIdentifierRet = swFeatMgr.SetComponentIdentifiers(swComponentIdentifier_ComponentName, swComponentIdentifier_ConfigurationName + swComponentIdentifier_ConfigurationDescription + swComponentIdentifier_ComponentDescription, swComponentIdentifier_DisplayStateName)
    Stop
   
  
End Sub

Remarks

This method:

  • Works in both SOLIDWORKS Desktop and SOLIDWORKS Connected.
  • Is analogous to right-clicking on the top-level component in the FeatureManager design tree and selecting Tree Display > Component Name and Description.
 

See Also

Availability

SOLIDWORKS 2022 SP01, Revision Number 30.1


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:   SetComponentIdentifiers Method (IFeatureManager)
*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) 2022 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.