All identifiers and IDs in the SOLIDWORKS API

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
[email protected]
[email protected]@Part1.Part
NoYesYesLink
Display dimensionIDisplayDimension. GetNameForSelection[email protected]Link
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, sketch segment ID and more
  5. (this post) All identifiers in the SOLIDWORKS API
  6. About return values
  7. Entities and GetCorresponding
  8. Selections, math and custom properties
  9. How to create task panes and Property Manager Pages
  10. How to create your own SOLIDWORKS add-in
  11. 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.