Rotate drawing view/section view by 270°

Hi everyone,

I recorded a macro while I was rotating my view by 270°.

Sub main()

Set swApp = _

Application.SldWorks

Set Part = swApp.ActiveDoc

boolstatus = Part.ActivateView("Zeichenansicht2")

boolstatus = Part.Extension.SelectByID2("Zeichenansicht2", "DRAWINGVIEW", 0.096440340216781, 0.146814729127943, 0, False, 0, Nothing, 0)

boolstatus = Part.Extension.SelectByID2("Zeichenansicht2", "DRAWINGVIEW", 9.68147518869837E-02, 0.149997228324665, 0, False, 0, Nothing, 0)

boolstatus = Part.Extension.SelectByID2("Zeichenansicht2", "DRAWINGVIEW", 9.68147518869837E-02, 0.149997228324665, 0, False, 0, Nothing, 0)

boolstatus = Part.Extension.SelectByID2("Zeichenansicht2", "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing, 0)

boolstatus = Part.DrawingViewRotate(4.7123889803847)

boolstatus = Part.Extension.SelectByID2("Zeichenansicht2", "DRAWINGVIEW", 0.123585186306471, 0.131463850649635, 0, False, 0, Nothing, 0)

End Sub

It works on the same sheet but if I open another file and try to use the macro it  does not work.

I guess the name of the view, (view 1, view 2, etc) is saved on my macro so it is not relevant for different drawing where we have 5 different views...

I would like to have a macro for this if possible... preselect the view and apply to it...

Many thanks in advance...

Regards

Janos

SolidworksApi macros