Dimension name display

Feb 21, 2006 6 Replies

Hello Group,



Is there a macro/key to toggle "dim name display" on/off. It is in the options, but I am looking for a hotkey. If somebody has a macro or "How to" ? Thanks



Singh S.


There is no Hotkey that I know of, but I do have a macro. Enjoy, Ken

'*************************** 'ToggleShowDimensionNames.swp '***************************

Option Explicit Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2

Sub main()

Set swApp = CreateObject("SldWorks.Application") Set swModel = swApp.ActiveDoc

If swApp.GetUserPreferenceToggle(swShowDimensionNames) Then swApp.SetUserPreferenceToggle swShowDimensionNames, False Else swApp.SetUserPreferenceToggle swShowDimensionNames, True End If

swModel.ViewZoomin swModel.ViewZoomout

End Sub

Here's one that's easier:

Dim swApp As Object Dim Model As Object

Sub main()

Set swApp = Application.SldWorks Set Model = swApp.ActiveDoc

DimensionNameShown = swApp.GetUserPreferenceToggle(swShowDimensionNames) swApp.SetUserPreferenceToggle swShowDimensionNames, Not (DimensionNameShown) 'Repaint Screen Model.GraphicsRedraw2

End Sub

Thanks Guys. This works Great. After running it I found One more thing though. If this macro can also turn on the dim display also if it is of at the same time along with the Dim Name.

It would toggle "Hide All Type" "Unhide All type and View Annotations" They are under view menu.

Singh S.

Option Explicit Dim swApp As SldWorks.SldWorks Dim swModel As SldWorks.ModelDoc2 Dim boolstatus As Boolean

Sub main()

Set swApp = CreateObject("SldWorks.Application") Set swModel = swApp.ActiveDoc

If swModel.GetUserPreferenceToggle(swViewDisplayHideAllTypes) Then boolstatus = swModel.SetUserPreferenceToggle(swViewDisplayHideAllTypes, False) Else boolstatus = swModel.SetUserPreferenceToggle(swViewDisplayHideAllTypes, True) End If

swModel.ViewZoomin swModel.ViewZoomout

End Sub

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required