I have an add-in I'm working on trying to get the names within an assembly to edit a dimension. When I record a macro, I can get the dimensions name, but I want my add-in to allow the user to select the dimension and then display it to the user. Here's a portion of the recorded macro:
swDoc.ActivateSelectedFeature(); boolstatus = swDoc.Extension.SelectByID2("D1@STOCK@Base Cylinder-1@L_S/Rear Cover-1@Base Cylinder", "DIMENSION", -0.13610586623579712, 0.064932066534194435, 0.047917612974635 false, 0, null, 0); swDoc.ClearSelection2(true);
What I can't seem to figure out is how to get the selected object to return that entire name.
I've tried GetNameForSelection, FullName and just name and all I can get is "D1@STOCK"
Anyone know how to do this?
Thanks
If the user has already selected the dimension, why do you need to select it using IModelDocExtension::SelectByID2? Or maybe you mean something different by "display it to user". It's not clear what you mean by this.
Anyway, the exact string for selecting a dimension in an assembly with IModelDocExtension::SelectByID2 is:
<string returned by IDisplayDimension::GetNameForSelection>@<string returned by IComponent2::GetSelectByIDString>
Keith
SolidWorks API Training