Anyone have a macro to Rotate Model (part or assy) to ISO view, Zoom View Extents then Save.
I have a recorded macro for each, just do not know how to combine them (assy/part)
Request from one of my users...to combine them
I think this is all you need, I didn't test it but it should work.
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
swModel.ShowNamedView2 "*Isometric", 7 ' set to iso view
swModel.ViewZoomtofit2 ' zoom to fit
swModel.EditRebuild ' rebuild doc
swModel.Save2 False ' save doc
I would suggest just recording that macro. If you need to edit it after the fact, you can just go into the code and tweak it. Also, take a peek at the code of your existing macros.
I have created this exact macro in the past, not sure where it is now. I can tell you it is not difficult, and recording a macro is a great place to start pretty much every time.
I have the recorded macro(s) been using them for years. But instead of one for Parts & one of Assemblies. the user has requested one combined, to run either.
Try the Zoom and Rebuild macro by Luke here: https://forum.solidworks.com/message/115227#115227
You'll have to edit the macro and set the path.
Thanks I will look at it
The link I've shared will work on all the files in the specified location.
Thanks all who responded....once i remembered swModel instead of part...my original macro worked.
Retrieving data ...