×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Default and custom view mapped to number pad

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   

RE: Default and custom view mapped to number pad

These already exist with the F keys.
F1 = Front
F2 = Back
F3 = LS
F4 = RS
F5 = Top
F6 = Bottom
F7 = Isometric
F8 = Normal to

cheers

RE: Default and custom view mapped to number pad

Doh ... sorry. I meant Ctrl+<number>.

cheers

RE: Default and custom view mapped to number pad

CBL,  there's a thing I've seen before that I think Rob is referring to where the numeric keypad is programmed with those views in the same orientation as a 3-Angle projected box is unfolded.  That part is easy enough.  It's the custom views that post a little challenge.

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

Ahh, I understand now. Thanks Matt.

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.

cheers

RE: Default and custom view mapped to number pad

Works just the same as mapping shortcuts to a letter key.  I have tons of shortcuts mapped to unmodified keystrokes.  SW knows when you oughtta be typing (like when the cursor is in a text box or a note) and disables those shortcuts.  Most of the time.  Very occasionally (maybe once per month, if that often), SW will get messed up and the place where I'm typing will not receive any keystrokes are mapped to shortcuts.  In that case I have to restart SW.

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

      Top
       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

Like Matt suggested, I have 7,9,1,3 mapped to macros.  However, in my case the macros rotate the model to achieve an iso view from the current view.  It comes in handy when I need an iso from a view other than Front.

RE: Default and custom view mapped to number pad

Here's a macro that was created many moons ago by Lee Bell and Wayne Tiffany that does what you want. Even works in drawings.

Steve R.

RE: Default and custom view mapped to number pad

(OP)
Thank you all.  Sorry for my slow response back, I was away on travel.  I took the 8 iso views macro and changed it so that there was 1 macro for each view and then mapped each macro to a #.  In the macros there is a zoom to fit which causes there to be an animation.  Does any body know how to get rid of this?  One of the macros is below.  Thanks again.
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

On your system options, "View" category, turn all "Transitions" to off.

-handleman, CSWP (The new, easy test)

RE: Default and custom view mapped to number pad

(OP)
Thanks handleman.

RE: Default and custom view mapped to number pad

(OP)
Here is the final macro that I settled on.  I break out each view and map them to an icon and a numberpad+ (ctrl, alt or shift) to get all the views on the fly.  Next to the name of the views I put the shortcut I use as a comment.  I have made a multi-sided die to help explain the views.  Hope this helps.

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
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources