Hide Table of Contents
GetID Method (IComponent2)

Gets the component ID for this component.

.NET Syntax

Visual Basic (Declaration) 
Function GetID() As System.Integer
Visual Basic (Usage) 
Dim instance As IComponent2
Dim value As System.Integer
 
value = instance.GetID()
C# 
System.int GetID()
C++/CLI 
System.int GetID(); 

Return Value

Component ID for this component

Example

Remarks

A component ID:

  • is unique within the context of the assembly to which it belongs.

    NOTE: A component ID might not be unique across subassemblies within the assembly. For example, a component in subassembly A might have a component ID of 1, and a component in subassembly B might also have a component ID of 1.

  • is persistent across SOLIDWORKS sessions and never changes, even if you change the name of the component.
  • can be used to identify a specific component in an assembly.
  • cannot be assigned by applications or users.
  • is not the same as a persistent reference ID. You can get any component using its persistent reference ID, but you cannot get a component using this method.
 

See Also

Availability

SOLIDWORKS 2014 FCS, Revision Number 22.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

 
*Email:  
Subject:   Feedback on Help Topics
Page:   GetID Method (IComponent2)
*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) 2015 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.