Get 5 FREE macros to save clicks while performing your day-to-day operations in SOLIDWORKS
Dimensions can be added to the selected sketch segments via IModelDocExtension::AddDimension SOLIDWORKS API method.
Each dimension has a unique name which can be assigned by the user. Dimension object can be retrieved by name via IModelDoc2::Parameter method.
Refer the IDimension SOLIDWORKS API interface for the list of available methods for dimensions automation.