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
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 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.
Karl
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.
I think this is all you need, I didn't test it but it should work.
Sub Save()
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
End Sub
I think this is all you need, I didn't test it but it should work.
Sub Save()
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
End Sub