SW assigns an internal ID to all features of model automatically. Users can't control or modify it.
It looks like the the internal ID of feature after modification has been changed and this is why dimension greed-out..
Try to modify the feature after dimension is set. this is the only way to keep dimension alive.
This macro will rename dimensions to your heart's content. Just select a dimension and run it.
Note that there's no checking for duplicate names. You can name as many dimensions as you want with the same name. No idea what happens if you screw that all up. Proceed with caution.
Dim swApp As SldWorks.SldWorks Dim swDim As SldWorks.Dimension Dim swDispDim As SldWorks.DisplayDimension Dim swSelMgr As SldWorks.SelectionMgr Dim sNewName As String Sub main() Set swApp = Application.SldWorks Set swSelMgr = swApp.ActiveDoc.SelectionManager If swSelMgr.GetSelectedObjectType3(1, -1) = swSelDIMENSIONS Then Set swDispDim = swSelMgr.GetSelectedObject6(1, -1) Set swDim = swDispDim.GetDimension2(1) sNewName = InputBox("Enter a new name for this dimension", "Dimension Name", swDim.Name) On Error Resume Next swDim.Name = sNewName Debug.Print swDim.FullName On Error GoTo 0 If swDim.Name <> sNewName Then MsgBox "Unable to rename this dimension. Why? I dunno. You figure it out." End If Else MsgBox "Select a dimension and then run this macro." End If End Sub
Many thanks. I will give this a try.
Just by luck I managed to work through this issue. I deleted the offending dimension; saved and closed the file; stopped and restarted SW; opened the file and inserted a new Reference Dimension. SW must have figured out that RD1 was no longer in use and it named the new dimension with that name - which is what I was after from the beginning. No downstream edits required.