×
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

View orientation in Macro

View orientation in Macro

View orientation in Macro

(OP)
I'm trying to switch to a predefined view in a part before the body of the macro executes.  Here is the start of the macro.

Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc
Set SelMgr = Part.SelectionManager


boolstatus = Part.Extension.SelectByID2("Sketch2", "SKETCH", 0, 0, 0, False, 0, Nothing, 0)
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Sketch2", "SKETCH", 0, 0, 0, False, 0, Nothing, 0)
Part.FeatureManager.FeatureExtrusion2 True, False, False, 0, 0, 0.1524, 0.01, False, False, False, False, 0.01745329251994, 0.01745329251994, False, False, False, False, 1, 1, 1, 0, 0, False
Part.SelectionManager.EnableContourSelection = 0



I'm using this command
Part.ShowNamedView2 "LogoView3", -1

I've placed this directly after Set SelMgr, but the macro reverts back to another view.  I then place this after the creation of the first body and it switches views.  My question is how can I have the view switch before I start creating bodies?

Thanks.

RE: View orientation in Macro

It looks like this macro was generated by the recorder.  The issue is probably that when you create your first extrusion feature in a part, the display automatically reorients to show an isometric type view of the extrusion.  There may be a way to create the extrude feature in a different way that doesn't do the reorientation.  However, what's the problem with putting your named view orientation after the creation of the first feature?

-handleman, CSWP (The new, easy test)

RE: View orientation in Macro

(OP)
I'm trying to capture the macro events in a movie and would like the entire macro to run at the predefined view.  

RE: View orientation in Macro

handleman,
I love the new signature, I thought of doing the same thing.

-Dustin
Professional Engineer
Certified SolidWorks Professional

RE: View orientation in Macro

If all you care about is the movie, just manually create some extrusion somewhere out off the screen, then run your macro.

-handleman, CSWP (The new, easy test)

RE: View orientation in Macro

Oh, and thanks, Dustin!  smile  It just doesn't feel right not qualifying the "CSWP" when some people took the test back when it really meant something.

-handleman, CSWP (The new, easy test)

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