All identifiers and IDs in the SOLIDWORKS API (part 5)

Below is a list of all identifiers, IDs and persistent references in SOLIDWORKS.

This post goes hand in hand with Persistent ID, sketch segment ID in the SOLIDWORKS API, where we explain how to use every single identifier that is used in the API.

Notes

  1. PRID = Persistent Reference ID
  2. Unique on one particular assembly level
  3. Unique in combination with element type and sketch name
  4. For features, Name and GetNameForSelection are generally identical

All identifiers

IdentifierObject typeAccessorTypeExamplePersistentAssignableAlso has PRID *1See noteExample
Single integerComponentIComponent2.GetIDint12YesNoYes*2Link
ConfigurationIConfiguration.GetIDYesNoLink
FeatureIFeature.GetIDYesNoLink
SheetISheet.GetIDYes?NoLink
EdgeIEdge.GetIDNoYes
LightILight.GetIDYesNoLink
LayerILayer.GetIDYesNoNoLink
Double integerSketch segmentISketchSegment.GetID2x int
or
2x long
12-42No?NoYes*3Link
Sketch hatchISketchHatch.GetIDLink
StringDimensionIDimension.Name
IDimension.GetNameForSelection
IDimension.FullName
stringD1
D1@Sketch1
D1@[email protected]
NoYesYesLink
Display dimensionIDisplayDimension. GetNameForSelectionD1@Sketch1Link
FeatureIFeature.Name
IFeature. GetNameForSelection
Extrude1
Extrude1
*4Link
Persistent Reference IDAll selectable objectsModelDocExtensions. GetPersistReference3byte array176-054-000-000-003-000-000-000-255-254-255-000-000-000-000-255YesNoLink
Tracking IDBody, edge, face, loop, vertexIBody2.GetTrackingIDs
IEdge.GetTrackingIDs
IFace2.GetTrackingIDs
Iloop2.GetTrackingIDs
IVertex.GetTrackingIDs
int12NoYesNoLink

All blog posts in this series

  1. The SOLIDWORKS Object Model + API explained
  2. SOLIDWORKS API: the basics - SldWorks, ModelDoc2
  3. How to work with Features 
  4. Persistent ID and sketch segment ID and more
  5. All identifiers in the SOLIDWORKS API
  6. About return values
  7. Entities and GetCorresponding
  8. How to work with selections
  9. How to use custom properties
  10. Understanding math, MathVector and MathTransform
  11. Toolbars, menus and the Command Manager
  12. How to create task panes and Property Manager Pages
  13. How to create your own SOLIDWORKS add-in
  14. Creating add-ins with SolidDNA: the basics

Don't miss the next post. Get a free add-in.

Subscribe to our newsletter and get our TimeSavers add-in for free.