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) |
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
See Also
Availability
SOLIDWORKS 2022 SP01, Revision Number 30.1