Default and custom view mapped to number pad
Default and custom view mapped to number pad
(OP)
Awhile back I remember seeing a thread about mapping views to the number pad similar to an unfolded box with:
5 top
2 front
0 bottom
8 back
4 left
6 right
period normal to view
I have implemented these as hot keys and it is very intuitive. I would also like to map 7,9,1,3 as 45deg isometric views of the top corners and ctrl+# as the bottom corners. Is this possible? Can custom views be added to shortcuts? Can these custom views be saved in a default template? If none of those work then I guess I could make a macro that is mapped to the keys for the corresponding view. Any thoughts? Thanks.
Rob Stupplebeen
5 top
2 front
0 bottom
8 back
4 left
6 right
period normal to view
I have implemented these as hot keys and it is very intuitive. I would also like to map 7,9,1,3 as 45deg isometric views of the top corners and ctrl+# as the bottom corners. Is this possible? Can custom views be added to shortcuts? Can these custom views be saved in a default template? If none of those work then I guess I could make a macro that is mapped to the keys for the corresponding view. Any thoughts? Thanks.
Rob Stupplebeen






RE: Default and custom view mapped to number pad
As far as I remember, only standard views can be shortcut assigned. However, you could create a small macro for each of those other views and program the keystroke for them.
Matt Lorono
CAD Engineer/ECN Analyst
Silicon Valley, CA
Lorono's SolidWorks Resources
Co-moderator of Solidworks Yahoo! Group
and Mechnical.Engineering Yahoo! Group
RE: Default and custom view mapped to number pad
F1 = Front
F2 = Back
F3 = LS
F4 = RS
F5 = Top
F6 = Bottom
F7 = Isometric
F8 = Normal to
RE: Default and custom view mapped to number pad
RE: Default and custom view mapped to number pad
Matt Lorono
CAD Engineer/ECN Analyst
Silicon Valley, CA
Lorono's SolidWorks Resources
Co-moderator of Solidworks Yahoo! Group
and Mechnical.Engineering Yahoo! Group
RE: Default and custom view mapped to number pad
Two points though;
What do you do when typing actual numbers? Do you have to use the main keyboard keys?
For me, 5 would be the 'logical' Front.
RE: Default and custom view mapped to number pad
I guess which key is logical front depends on how you're used to looking at stuff. I suppose the "box" won't actually unfold correctly unless 5 is the front. It will never actually "unfold" properly if the back view is in line vertically with the top/front views since SW shows the back view right side up. If it unfolded correctly from a 5 top to an 8 back then the part would be upside down. To unfold the back view properly, it would have to be in line horizontally with the front - like
CODE
8
Left Frt Rght Back
4 5 6 +
Btm
1
-handleman, CSWP (The new, easy test)
RE: Default and custom view mapped to number pad
RE: Default and custom view mapped to number pad
RE: Default and custom view mapped to number pad
Steve R.
RE: Default and custom view mapped to number pad
RE: Default and custom view mapped to number pad
Rob Stupplebeen
' ******************************************************
' ISOViews.swp – Recorded on 12/20/01 by Mike J. Wilson
' ISOViews.swp – Updated on 6/7/05 by Heckler
' ******************************************************
Sub main()
Set swApp = CreateObject("SldWorks.Application")
Set Part = swApp.ActiveDoc
pi = 4 * Atn(1)
Z = Tan(30 * pi / 180)
X = Atn(Z / Sqr(-Z * Z + 1))
Y = -45 * pi / 180
Part.ShowNamedView2 "*Front", -1
Part.ActiveView().RotateAboutCenter -X, Y
Part.ViewZoomtofit
Set Part = Nothing
Set swApp = Nothing
Set swApp = Application.SldWorks
End Sub
RE: Default and custom view mapped to number pad
-handleman, CSWP (The new, easy test)
RE: Default and custom view mapped to number pad
RE: Default and custom view mapped to number pad
Rob Stupplebeen
' ******************************************************
' ISOViews.swp – Recorded on 12/20/01 by Mike J. Wilson
' ISOViews.swp – Updated on 6/7/05 by Heckler
' ISOViews.swp – Updated on 6/3/08 by Stupplebeen
' ******************************************************
Sub main()
Set swApp = CreateObject("SldWorks.Application")
Set Part = swApp.ActiveDoc
pi = 4 * Atn(1)
Z = Tan(30 * pi / 180)
X = Atn(Z / Sqr(-Z * Z + 1))
Y = -45 * pi / 180
Part.DeleteNamedView "ISO-TRF" '3
Part.DeleteNamedView "ISO-TRB" '9
Part.DeleteNamedView "ISO-TLF" '1
Part.DeleteNamedView "ISO-TLB" '7
Part.DeleteNamedView "ISO-BRF" '3C
Part.DeleteNamedView "ISO-BRB" '9C
Part.DeleteNamedView "ISO-BLF" '1C
Part.DeleteNamedView "ISO-BLB" '7C
Part.DeleteNamedView "45-TF" '2A
Part.DeleteNamedView "45-TR" '6A
Part.DeleteNamedView "45-TB" '8A
Part.DeleteNamedView "45-TL" '4A
Part.DeleteNamedView "45-BF" '2C
Part.DeleteNamedView "45-BR" '6C
Part.DeleteNamedView "45-BB" '8C
Part.DeleteNamedView "45-BL" '4C
Part.DeleteNamedView "45-RF" '3A
Part.DeleteNamedView "45-RB" '9A
Part.DeleteNamedView "45-LF" '1A
Part.DeleteNamedView "45-LB" '7A
Part.ShowNamedView2 "*Front", -1
Part.ActiveView().RotateAboutCenter X, Y
Part.ViewZoomtofit
Part.NameView "ISO-TRF"
Part.ShowNamedView2 "*Right", -1
Part.ActiveView().RotateAboutCenter X, Y
Part.ViewZoomtofit
Part.NameView "ISO-TRB"
Part.ShowNamedView2 "*Left", -1
Part.ActiveView().RotateAboutCenter X, Y
Part.ViewZoomtofit
Part.NameView "ISO-TLF"
Part.ShowNamedView2 "*Back", -1
Part.ActiveView().RotateAboutCenter X, Y
Part.ViewZoomtofit
Part.NameView "ISO-TLB"
Part.ShowNamedView2 "*Front", -1
Part.ActiveView().RotateAboutCenter -X, Y
Part.ViewZoomtofit
Part.NameView "ISO-BRF"
Part.ShowNamedView2 "*Right", -1
Part.ActiveView().RotateAboutCenter -X, Y
Part.ViewZoomtofit
Part.NameView "ISO-BRB"
Part.ShowNamedView2 "*Left", -1
Part.ActiveView().RotateAboutCenter -X, Y
Part.ViewZoomtofit
Part.NameView "ISO-BLF"
Part.ShowNamedView2 "*Back", -1
Part.ActiveView().RotateAboutCenter -X, Y
Part.ViewZoomtofit
Part.NameView "ISO-BLB"
Part.ShowNamedView2 "*Front", -1
Part.ActiveView().RotateAboutCenter -Y, 0
Part.ViewZoomtofit
Part.NameView "45-TF"
Part.ShowNamedView2 "*Right", -1
Part.ActiveView().RotateAboutCenter -Y, 0
Part.ViewZoomtofit
Part.NameView "45-TR"
Part.ShowNamedView2 "*Back", -1
Part.ActiveView().RotateAboutCenter -Y, 0
Part.ViewZoomtofit
Part.NameView "45-TB"
Part.ShowNamedView2 "*Left", -1
Part.ActiveView().RotateAboutCenter -Y, 0
Part.ViewZoomtofit
Part.NameView "45-TL"
Part.ShowNamedView2 "*Front", -1
Part.ActiveView().RotateAboutCenter Y, 0
Part.ViewZoomtofit
Part.NameView "45-BF"
Part.ShowNamedView2 "*Right", -1
Part.ActiveView().RotateAboutCenter Y, 0
Part.ViewZoomtofit
Part.NameView "45-BR"
Part.ShowNamedView2 "*Back", -1
Part.ActiveView().RotateAboutCenter Y, 0
Part.ViewZoomtofit
Part.NameView "45-BB"
Part.ShowNamedView2 "*Left", -1
Part.ActiveView().RotateAboutCenter Y, 0
Part.ViewZoomtofit
Part.NameView "45-BL"
Part.ShowNamedView2 "*Front", -1
Part.ActiveView().RotateAboutCenter 0, Y
Part.ViewZoomtofit
Part.NameView "45-RF"
Part.ShowNamedView2 "*Back", -1
Part.ActiveView().RotateAboutCenter 0, -Y
Part.ViewZoomtofit
Part.NameView "45-RB"
Part.ShowNamedView2 "*Front", -1
Part.ActiveView().RotateAboutCenter 0, -Y
Part.ViewZoomtofit
Part.NameView "45-LF"
Part.ShowNamedView2 "*Back", -1
Part.ActiveView().RotateAboutCenter 0, Y
Part.ViewZoomtofit
Part.NameView "45-LB"
Set Part = Nothing
Set swApp = Nothing
Set swApp = Application.SldWorks
End Sub