Is there a way that I can use a hotkey when dimensioning that would add the inspection dimension circle to the next dimension next feature I dimension?
for example … I use ordinate dimensions … i have say 12 items to dimension, 3 of which are critical, so i would want them to be circled. currently, I dimension all of the the dimensions and then go back .. highlight the 3 that i want to mark as inspection dimension, and then click that button to add the circle.
Wondering if i can do that on the fly. Start adding the 12 ordinates, but as I come to the critical dimension, hit ctrl, or alt, or some hotkey so that the next item selected would have the circle added. this could save me some time if its possible.
Not built in. But if you map this macro to a hotkey, you can hit that button after you insert a dimension and it will add the inspection circle.
It’s actually a bit more versatile than that. It will add the circle to any and all dimensions that are selected at any time. Dimensions are automatically selected immediately after insertion, so that’s why this works. But it will work with your old workflow as well.
Sub main()
Dim swApp As SldWorks.SldWorks
Set swApp = Application.SldWorks
Dim swDim As SldWorks.DisplayDimension
Dim swSels As SldWorks.SelectionMgr
Set swSels = swApp.ActiveDoc.SelectionManager
Dim i As Long
For i = 1 To swSels.GetSelectedObjectCount2(-1)
If swSels.GetSelectedObjectType3(i, -1) = swSelDIMENSIONS Then
Set swDim = swSels.GetSelectedObject6(i, -1)
swDim.Inspection = True
End If
Next i
End Sub
I would add a little logic to toggle the existing value instead of just setting it to True.
Sub main()
Dim swApp As SldWorks.SldWorks
Set swApp = Application.SldWorks
Dim swDim As SldWorks.DisplayDimension
Dim swSels As SldWorks.SelectionMgr
Set swSels = swApp.ActiveDoc.SelectionManager
Dim i As Long
For i = 1 To swSels.GetSelectedObjectCount2(-1)
If swSels.GetSelectedObjectType3(i, -1) = swSelDIMENSIONS Then
Set swDim = swSels.GetSelectedObject6(i, -1)
If Not swDim.Inspection = False Then
swDim.Inspection = False
Else
swDim.Inspection = True
End If
End If
Next i
mDoc.GraphicsRedraw2
End Sub
Just to clarify, Josh’s code does exactly what you asked for. If you are in the process of adding ordinate dimensions, as soon as you click to place a dimension, you can press your hotkey and it will add the inspection bubble. It may require a little mouse movement for the display to update.
I don’t think I’d say “exactly”… He did say he wanted the action to apply to the next thing clicked, not the last thing like my code does. The next thing would be possible, but significantly more complicated and messy.
I have an app for this task. It allows you to add dimension #, select specific dimensions, and mark critical dimensions using a triangle symbol - see clip