Dimension name display

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.

Reply to
Singh S
Loading thread data ...

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

Reply to
Tin Man

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

Reply to
Fye

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.

Reply to
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

Reply to
Tin Man

Works Great !!!

Thanks Ken

Reply to
Singh S

Addin that does this. Has toolbar.

Reply to
That70sTick

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.