AnsweredAssumed Answered

CreateUnfoldedViewAt3→Alignment is error?

Question asked by Yong Ning on Apr 26, 2017
Latest reply on Apr 27, 2017 by Peter Brinkhuis

Alignment.jpg

 

Question

                        Set SwView = SwDraw.CreateDrawViewFromModelView3(ModelName, ViewName, Xx, Yy, 0)

                        Tmp = SwModel.Extension.SelectByID2(SwView.Name, "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing, 0)

                        Set SwView = SwDraw.CreateUnfoldedViewAt3(Xx, Yy, 0, False)

 

result is Alignment is error.

 

 

******************************************************************

 

 

Sub LS1()

    Dim SwApp As SldWorks.SldWorks, SwModel As ModelDoc2

        Set SwApp = Application.SldWorks

        Set SwModel = SwApp.ActiveDoc

    Dim SwSelMgr As SelectionMgr

        Set SwSelMgr = SwModel.SelectionManager

    Dim SwView As View, SwView1 As View

        boolstatus = SwModel.Extension.SelectByID2("鞍座S主视图", "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing, 0)

        Set SwView = SwSelMgr.GetSelectedObject5(1)

        ''

        boolstatus = SwModel.Extension.SelectByID2("鞍座S视图", "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing, 1)

        Set SwView1 = SwSelMgr.GetSelectedObject5(1)

        Stop

        boolstatus = SwView1.AlignWithView(2, SwView)

 

 

End Sub

Outcomes