CycloneWade
Automotive
- Apr 1, 2005
- 76
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.
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.