3 Replies Latest reply on Sep 28, 2017 1:26 PM by Daen Hendrickson

    Is there a way to edit Assembly Reference Dimensions

    Daen Hendrickson

      I am still using SW2014 SP5.

       

      When creating Reference Dimensions in assemblies, the name is auto-assigned and grayed-out.

       

      I have a file that is a copied-and-modified version. An existing Reference Dimension has gone "wonkey".

       

      Yes, I could just delete and recreate... However, I have linked information to it and I have a number of other similar files with the same setup. If I delete and recreate, I won't get the same name, can't edit the assigned name, will have to "special case" this one particular assembly so it is different than the others in the group. My "particular about details" nature is SCREAMING. I think they have a three-letter acronym for that...

       

      Thanks,

      Daen

        • Re: Is there a way to edit Assembly Reference Dimensions
          Vladimir Urazhdin

          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.

          • Re: Is there a way to edit Assembly Reference Dimensions
            Josh Brady

            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
            
              • Re: Is there a way to edit Assembly Reference Dimensions
                Daen Hendrickson

                Josh,

                 

                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.

                 

                Daen